From 86d23dcb2b996a8f2f86606969b54891cb186f84 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Sat, 3 Sep 2022 16:18:19 -0400 Subject: [PATCH 01/10] Revert "web-sys: Added full Streams WebIDL (#3046)" This reverts commit e8a499c36b41e197c7a1bd95050c73a6148e3f07. --- .../features/gen_ByteLengthQueuingStrategy.rs | 36 --- .../src/features/gen_CountQueuingStrategy.rs | 36 --- .../src/features/gen_QueuingStrategyInit.rs | 40 --- .../gen_ReadableByteStreamController.rs | 67 ------ .../src/features/gen_ReadableStream.rs | 8 + .../gen_ReadableStreamByobReadResult.rs | 70 ++++++ .../features/gen_ReadableStreamByobReader.rs | 32 +++ .../features/gen_ReadableStreamByobRequest.rs | 52 ---- .../gen_ReadableStreamDefaultController.rs | 59 ----- .../gen_ReadableStreamDefaultReadResult.rs | 70 ++++++ .../gen_ReadableStreamDefaultReader.rs | 28 +++ .../features/gen_ReadableStreamReadResult.rs | 53 ---- .../src/features/gen_ReadableStreamType.rs | 10 - .../src/features/gen_ReadableWritablePair.rs | 8 + .../src/features/gen_TransformStream.rs | 12 + .../gen_TransformStreamDefaultController.rs | 62 ----- .../web-sys/src/features/gen_Transformer.rs | 104 -------- .../src/features/gen_UnderlyingSink.rs | 92 ------- .../src/features/gen_UnderlyingSource.rs | 98 -------- .../src/features/gen_WritableStream.rs | 24 ++ .../gen_WritableStreamDefaultController.rs | 36 --- .../gen_WritableStreamDefaultWriter.rs | 44 ++++ crates/web-sys/src/features/mod.rs | 86 +------ .../webidls/enabled/ReadableStream.webidl | 47 ++++ crates/web-sys/webidls/enabled/Streams.webidl | 227 ------------------ .../unstable/ReadableStreamBYOBReader.webidl | 22 ++ .../ReadableStreamDefaultReader.webidl | 22 ++ .../ReadableStreamGenericReader.webidl | 14 ++ .../webidls/unstable/TransformStream.webidl | 16 ++ .../webidls/unstable/WritableStream.webidl | 19 ++ .../WritableStreamDefaultWriter.webidl | 22 ++ 31 files changed, 468 insertions(+), 1048 deletions(-) delete mode 100644 crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs delete mode 100644 crates/web-sys/src/features/gen_CountQueuingStrategy.rs delete mode 100644 crates/web-sys/src/features/gen_QueuingStrategyInit.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableByteStreamController.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamReadResult.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamType.rs delete mode 100644 crates/web-sys/src/features/gen_TransformStreamDefaultController.rs delete mode 100644 crates/web-sys/src/features/gen_Transformer.rs delete mode 100644 crates/web-sys/src/features/gen_UnderlyingSink.rs delete mode 100644 crates/web-sys/src/features/gen_UnderlyingSource.rs delete mode 100644 crates/web-sys/src/features/gen_WritableStreamDefaultController.rs create mode 100644 crates/web-sys/webidls/enabled/ReadableStream.webidl delete mode 100644 crates/web-sys/webidls/enabled/Streams.webidl create mode 100644 crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl create mode 100644 crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl create mode 100644 crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl create mode 100644 crates/web-sys/webidls/unstable/TransformStream.webidl create mode 100644 crates/web-sys/webidls/unstable/WritableStream.webidl create mode 100644 crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl diff --git a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs deleted file mode 100644 index c29737f5378..00000000000 --- a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ByteLengthQueuingStrategy , typescript_type = "ByteLengthQueuingStrategy")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ByteLengthQueuingStrategy` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] - pub type ByteLengthQueuingStrategy; - # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = highWaterMark)] - #[doc = "Getter for the `highWaterMark` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] - pub fn high_water_mark(this: &ByteLengthQueuingStrategy) -> f64; - # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = size)] - #[doc = "Getter for the `size` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/size)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] - pub fn size(this: &ByteLengthQueuingStrategy) -> ::js_sys::Function; - #[cfg(feature = "QueuingStrategyInit")] - #[wasm_bindgen(catch, constructor, js_class = "ByteLengthQueuingStrategy")] - #[doc = "The `new ByteLengthQueuingStrategy(..)` constructor, creating a new instance of `ByteLengthQueuingStrategy`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`, `QueuingStrategyInit`*"] - pub fn new(init: &QueuingStrategyInit) -> Result; -} diff --git a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs deleted file mode 100644 index 779ba5b5b5d..00000000000 --- a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CountQueuingStrategy , typescript_type = "CountQueuingStrategy")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `CountQueuingStrategy` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] - pub type CountQueuingStrategy; - # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = highWaterMark)] - #[doc = "Getter for the `highWaterMark` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/highWaterMark)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] - pub fn high_water_mark(this: &CountQueuingStrategy) -> f64; - # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = size)] - #[doc = "Getter for the `size` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/size)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] - pub fn size(this: &CountQueuingStrategy) -> ::js_sys::Function; - #[cfg(feature = "QueuingStrategyInit")] - #[wasm_bindgen(catch, constructor, js_class = "CountQueuingStrategy")] - #[doc = "The `new CountQueuingStrategy(..)` constructor, creating a new instance of `CountQueuingStrategy`."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`, `QueuingStrategyInit`*"] - pub fn new(init: &QueuingStrategyInit) -> Result; -} diff --git a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs deleted file mode 100644 index 89141292fbc..00000000000 --- a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategyInit)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `QueuingStrategyInit` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] - pub type QueuingStrategyInit; -} -impl QueuingStrategyInit { - #[doc = "Construct a new `QueuingStrategyInit`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] - pub fn new(high_water_mark: f64) -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret.high_water_mark(high_water_mark); - ret - } - #[doc = "Change the `highWaterMark` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] - pub fn high_water_mark(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("highWaterMark"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} diff --git a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs deleted file mode 100644 index 6fed9016f1c..00000000000 --- a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs +++ /dev/null @@ -1,67 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableByteStreamController , typescript_type = "ReadableByteStreamController")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableByteStreamController` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub type ReadableByteStreamController; - #[cfg(feature = "ReadableStreamByobRequest")] - # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = byobRequest)] - #[doc = "Getter for the `byobRequest` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/byobRequest)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`, `ReadableStreamByobRequest`*"] - pub fn byob_request(this: &ReadableByteStreamController) -> Option; - # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = desiredSize)] - #[doc = "Getter for the `desiredSize` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/desiredSize)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn desired_size(this: &ReadableByteStreamController) -> Option; - # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = close)] - #[doc = "The `close()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/close)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn close(this: &ReadableByteStreamController); - # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] - #[doc = "The `enqueue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn enqueue_with_array_buffer_view( - this: &ReadableByteStreamController, - chunk: &::js_sys::Object, - ); - # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] - #[doc = "The `enqueue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn enqueue_with_u8_array(this: &ReadableByteStreamController, chunk: &mut [u8]); - # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn error(this: &ReadableByteStreamController); - # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn error_with_e(this: &ReadableByteStreamController, e: &::wasm_bindgen::JsValue); -} diff --git a/crates/web-sys/src/features/gen_ReadableStream.rs b/crates/web-sys/src/features/gen_ReadableStream.rs index c66b913be9e..a68f982b964 100644 --- a/crates/web-sys/src/features/gen_ReadableStream.rs +++ b/crates/web-sys/src/features/gen_ReadableStream.rs @@ -112,6 +112,7 @@ extern "C" { transform: &ReadableWritablePair, options: &StreamPipeOptions, ) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -119,7 +120,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -127,6 +132,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to_with_options( this: &ReadableStream, destination: &WritableStream, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs new file mode 100644 index 00000000000..eb58aeca844 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs @@ -0,0 +1,70 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReadResult)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamByobReadResult` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ReadableStreamByobReadResult; +} +#[cfg(web_sys_unstable_apis)] +impl ReadableStreamByobReadResult { + #[doc = "Construct a new `ReadableStreamByobReadResult`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn done(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn value(&mut self, val: &::js_sys::Object) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for ReadableStreamByobReadResult { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs index 1f051255192..a630495bad7 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReader , typescript_type = "ReadableStreamBYOBReader")] @@ -10,14 +11,22 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamByobReader; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamByobReader) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamBYOBReader")] #[doc = "The `new ReadableStreamByobReader(..)` constructor, creating a new instance of `ReadableStreamByobReader`."] @@ -25,47 +34,70 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_array_buffer_view( this: &ReadableStreamByobReader, view: &::js_sys::Object, ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_u8_array( this: &ReadableStreamByobReader, view: &mut [u8], ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamByobReader); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamByobReader) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamByobReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs deleted file mode 100644 index 44eac4614ab..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs +++ /dev/null @@ -1,52 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBRequest , typescript_type = "ReadableStreamBYOBRequest")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamByobRequest` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] - pub type ReadableStreamByobRequest; - # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBRequest" , js_name = view)] - #[doc = "Getter for the `view` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/view)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] - pub fn view(this: &ReadableStreamByobRequest) -> Option<::js_sys::Object>; - # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] - #[doc = "The `respond()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] - pub fn respond_with_u32(this: &ReadableStreamByobRequest, bytes_written: u32); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] - #[doc = "The `respond()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] - pub fn respond_with_f64(this: &ReadableStreamByobRequest, bytes_written: f64); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] - #[doc = "The `respondWithNewView()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] - pub fn respond_with_new_view_with_array_buffer_view( - this: &ReadableStreamByobRequest, - view: &::js_sys::Object, - ); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] - #[doc = "The `respondWithNewView()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] - pub fn respond_with_new_view_with_u8_array(this: &ReadableStreamByobRequest, view: &mut [u8]); -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs deleted file mode 100644 index d623f4b0ad0..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs +++ /dev/null @@ -1,59 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultController , typescript_type = "ReadableStreamDefaultController")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamDefaultController` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub type ReadableStreamDefaultController; - # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultController" , js_name = desiredSize)] - #[doc = "Getter for the `desiredSize` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/desiredSize)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn desired_size(this: &ReadableStreamDefaultController) -> Option; - # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = close)] - #[doc = "The `close()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/close)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn close(this: &ReadableStreamDefaultController); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] - #[doc = "The `enqueue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn enqueue(this: &ReadableStreamDefaultController); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] - #[doc = "The `enqueue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn enqueue_with_chunk( - this: &ReadableStreamDefaultController, - chunk: &::wasm_bindgen::JsValue, - ); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn error(this: &ReadableStreamDefaultController); - # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn error_with_e(this: &ReadableStreamDefaultController, e: &::wasm_bindgen::JsValue); -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs new file mode 100644 index 00000000000..82bbf8ca1e1 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs @@ -0,0 +1,70 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReadResult)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamDefaultReadResult` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub type ReadableStreamDefaultReadResult; +} +#[cfg(web_sys_unstable_apis)] +impl ReadableStreamDefaultReadResult { + #[doc = "Construct a new `ReadableStreamDefaultReadResult`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn done(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(web_sys_unstable_apis)] + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] + pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +#[cfg(web_sys_unstable_apis)] +impl Default for ReadableStreamDefaultReadResult { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs index 6b12a74ca6b..e47c2a3073f 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReader , typescript_type = "ReadableStreamDefaultReader")] @@ -10,14 +11,22 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamDefaultReader; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamDefaultReader")] #[doc = "The `new ReadableStreamDefaultReader(..)` constructor, creating a new instance of `ReadableStreamDefaultReader`."] @@ -25,34 +34,53 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamDefaultReader); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamDefaultReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs deleted file mode 100644 index 794dc0e9b0a..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs +++ /dev/null @@ -1,53 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] - pub type ReadableStreamReadResult; -} -impl ReadableStreamReadResult { - #[doc = "Construct a new `ReadableStreamReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] - pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for ReadableStreamReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamType.rs b/crates/web-sys/src/features/gen_ReadableStreamType.rs deleted file mode 100644 index 5bbe4467f36..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamType.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![allow(unused_imports)] -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -#[doc = "The `ReadableStreamType` enum."] -#[doc = ""] -#[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`*"] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum ReadableStreamType { - Bytes = "bytes", -} diff --git a/crates/web-sys/src/features/gen_ReadableWritablePair.rs b/crates/web-sys/src/features/gen_ReadableWritablePair.rs index 8a34d98aca5..0ce861e74ab 100644 --- a/crates/web-sys/src/features/gen_ReadableWritablePair.rs +++ b/crates/web-sys/src/features/gen_ReadableWritablePair.rs @@ -11,10 +11,14 @@ extern "C" { pub type ReadableWritablePair; } impl ReadableWritablePair { + #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "ReadableStream", feature = "WritableStream",))] #[doc = "Construct a new `ReadableWritablePair`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(readable: &ReadableStream, writable: &WritableStream) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); @@ -40,10 +44,14 @@ impl ReadableWritablePair { let _ = r; self } + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[doc = "Change the `writable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(&mut self, val: &WritableStream) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( diff --git a/crates/web-sys/src/features/gen_TransformStream.rs b/crates/web-sys/src/features/gen_TransformStream.rs index 9dd64d45d33..d2a041a700c 100644 --- a/crates/web-sys/src/features/gen_TransformStream.rs +++ b/crates/web-sys/src/features/gen_TransformStream.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStream , typescript_type = "TransformStream")] @@ -10,7 +11,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type TransformStream; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] #[doc = "Getter for the `readable` field of this object."] @@ -18,7 +23,11 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn readable(this: &TransformStream) -> ReadableStream; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] #[doc = "Getter for the `writable` field of this object."] @@ -26,6 +35,9 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(this: &TransformStream) -> WritableStream; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] diff --git a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs deleted file mode 100644 index 4add045b0c0..00000000000 --- a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs +++ /dev/null @@ -1,62 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStreamDefaultController , typescript_type = "TransformStreamDefaultController")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `TransformStreamDefaultController` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub type TransformStreamDefaultController; - # [wasm_bindgen (structural , method , getter , js_class = "TransformStreamDefaultController" , js_name = desiredSize)] - #[doc = "Getter for the `desiredSize` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/desiredSize)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn desired_size(this: &TransformStreamDefaultController) -> Option; - # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] - #[doc = "The `enqueue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn enqueue(this: &TransformStreamDefaultController); - # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] - #[doc = "The `enqueue()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn enqueue_with_chunk( - this: &TransformStreamDefaultController, - chunk: &::wasm_bindgen::JsValue, - ); - # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn error(this: &TransformStreamDefaultController); - # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn error_with_reason( - this: &TransformStreamDefaultController, - reason: &::wasm_bindgen::JsValue, - ); - # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] - #[doc = "The `terminate()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/terminate)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn terminate(this: &TransformStreamDefaultController); -} diff --git a/crates/web-sys/src/features/gen_Transformer.rs b/crates/web-sys/src/features/gen_Transformer.rs deleted file mode 100644 index c0dddae0727..00000000000 --- a/crates/web-sys/src/features/gen_Transformer.rs +++ /dev/null @@ -1,104 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Transformer)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `Transformer` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub type Transformer; -} -impl Transformer { - #[doc = "Construct a new `Transformer`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `flush` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub fn flush(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flush"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `readableType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub fn readable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("readableType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `start` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `transform` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub fn transform(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("transform"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `writableType` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] - pub fn writable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("writableType"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for Transformer { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_UnderlyingSink.rs b/crates/web-sys/src/features/gen_UnderlyingSink.rs deleted file mode 100644 index dd69488671c..00000000000 --- a/crates/web-sys/src/features/gen_UnderlyingSink.rs +++ /dev/null @@ -1,92 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSink)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `UnderlyingSink` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub type UnderlyingSink; -} -impl UnderlyingSink { - #[doc = "Construct a new `UnderlyingSink`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `abort` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub fn abort(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("abort"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `close` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub fn close(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("close"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `start` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub fn type_(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `write` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] - pub fn write(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("write"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for UnderlyingSink { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_UnderlyingSource.rs b/crates/web-sys/src/features/gen_UnderlyingSource.rs deleted file mode 100644 index a6a90943179..00000000000 --- a/crates/web-sys/src/features/gen_UnderlyingSource.rs +++ /dev/null @@ -1,98 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSource)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `UnderlyingSource` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] - pub type UnderlyingSource; -} -impl UnderlyingSource { - #[doc = "Construct a new `UnderlyingSource`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[doc = "Change the `autoAllocateChunkSize` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] - pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set( - self.as_ref(), - &JsValue::from("autoAllocateChunkSize"), - &JsValue::from(val), - ); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `cancel` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] - pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = - ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cancel"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `pull` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] - pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pull"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[doc = "Change the `start` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] - pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(feature = "ReadableStreamType")] - #[doc = "Change the `type` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"] - pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -impl Default for UnderlyingSource { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index d4123011279..7f9ed141e58 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStream , typescript_type = "WritableStream")] @@ -10,13 +11,20 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStream; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] #[doc = "Getter for the `locked` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn locked(this: &WritableStream) -> bool; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] @@ -57,30 +65,43 @@ extern "C" { underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, ) -> Result; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStream) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStream, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStream) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStreamDefaultWriter")] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = getWriter)] #[doc = "The `getWriter()` method."] @@ -88,5 +109,8 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; } diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs deleted file mode 100644 index 424a635c96a..00000000000 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultController , typescript_type = "WritableStreamDefaultController")] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `WritableStreamDefaultController` class."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] - pub type WritableStreamDefaultController; - #[cfg(feature = "AbortSignal")] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultController" , js_name = signal)] - #[doc = "Getter for the `signal` field of this object."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/signal)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WritableStreamDefaultController`*"] - pub fn signal(this: &WritableStreamDefaultController) -> AbortSignal; - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] - pub fn error(this: &WritableStreamDefaultController); - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] - #[doc = "The `error()` method."] - #[doc = ""] - #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] - pub fn error_with_e(this: &WritableStreamDefaultController, e: &::wasm_bindgen::JsValue); -} diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index b52551db43d..1ba5bd8b6ce 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -1,6 +1,7 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; +#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultWriter , typescript_type = "WritableStreamDefaultWriter")] @@ -10,28 +11,44 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStreamDefaultWriter; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] #[doc = "Getter for the `desiredSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/desiredSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn desired_size(this: &WritableStreamDefaultWriter) -> Option; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = ready)] #[doc = "Getter for the `ready` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/ready)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] @@ -39,51 +56,78 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &WritableStream) -> Result; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStreamDefaultWriter, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &WritableStreamDefaultWriter); + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] + #[doc = ""] + #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] + #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_chunk( this: &WritableStreamDefaultWriter, chunk: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index dfb2a94cac1..59d6818792d 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -718,12 +718,6 @@ mod gen_BrowserFindDirection; #[cfg(feature = "BrowserFindDirection")] pub use gen_BrowserFindDirection::*; -#[cfg(feature = "ByteLengthQueuingStrategy")] -#[allow(non_snake_case)] -mod gen_ByteLengthQueuingStrategy; -#[cfg(feature = "ByteLengthQueuingStrategy")] -pub use gen_ByteLengthQueuingStrategy::*; - #[cfg(feature = "Cache")] #[allow(non_snake_case)] mod gen_Cache; @@ -1162,12 +1156,6 @@ mod gen_Coordinates; #[cfg(feature = "Coordinates")] pub use gen_Coordinates::*; -#[cfg(feature = "CountQueuingStrategy")] -#[allow(non_snake_case)] -mod gen_CountQueuingStrategy; -#[cfg(feature = "CountQueuingStrategy")] -pub use gen_CountQueuingStrategy::*; - #[cfg(feature = "Credential")] #[allow(non_snake_case)] mod gen_Credential; @@ -5668,12 +5656,6 @@ mod gen_QueuingStrategy; #[cfg(feature = "QueuingStrategy")] pub use gen_QueuingStrategy::*; -#[cfg(feature = "QueuingStrategyInit")] -#[allow(non_snake_case)] -mod gen_QueuingStrategyInit; -#[cfg(feature = "QueuingStrategyInit")] -pub use gen_QueuingStrategyInit::*; - #[cfg(feature = "RadioNodeList")] #[allow(non_snake_case)] mod gen_RadioNodeList; @@ -5698,35 +5680,29 @@ mod gen_RcwnStatus; #[cfg(feature = "RcwnStatus")] pub use gen_RcwnStatus::*; -#[cfg(feature = "ReadableByteStreamController")] -#[allow(non_snake_case)] -mod gen_ReadableByteStreamController; -#[cfg(feature = "ReadableByteStreamController")] -pub use gen_ReadableByteStreamController::*; - #[cfg(feature = "ReadableStream")] #[allow(non_snake_case)] mod gen_ReadableStream; #[cfg(feature = "ReadableStream")] pub use gen_ReadableStream::*; +#[cfg(feature = "ReadableStreamByobReadResult")] +#[allow(non_snake_case)] +mod gen_ReadableStreamByobReadResult; +#[cfg(feature = "ReadableStreamByobReadResult")] +pub use gen_ReadableStreamByobReadResult::*; + #[cfg(feature = "ReadableStreamByobReader")] #[allow(non_snake_case)] mod gen_ReadableStreamByobReader; #[cfg(feature = "ReadableStreamByobReader")] pub use gen_ReadableStreamByobReader::*; -#[cfg(feature = "ReadableStreamByobRequest")] +#[cfg(feature = "ReadableStreamDefaultReadResult")] #[allow(non_snake_case)] -mod gen_ReadableStreamByobRequest; -#[cfg(feature = "ReadableStreamByobRequest")] -pub use gen_ReadableStreamByobRequest::*; - -#[cfg(feature = "ReadableStreamDefaultController")] -#[allow(non_snake_case)] -mod gen_ReadableStreamDefaultController; -#[cfg(feature = "ReadableStreamDefaultController")] -pub use gen_ReadableStreamDefaultController::*; +mod gen_ReadableStreamDefaultReadResult; +#[cfg(feature = "ReadableStreamDefaultReadResult")] +pub use gen_ReadableStreamDefaultReadResult::*; #[cfg(feature = "ReadableStreamDefaultReader")] #[allow(non_snake_case)] @@ -5746,24 +5722,12 @@ mod gen_ReadableStreamIteratorOptions; #[cfg(feature = "ReadableStreamIteratorOptions")] pub use gen_ReadableStreamIteratorOptions::*; -#[cfg(feature = "ReadableStreamReadResult")] -#[allow(non_snake_case)] -mod gen_ReadableStreamReadResult; -#[cfg(feature = "ReadableStreamReadResult")] -pub use gen_ReadableStreamReadResult::*; - #[cfg(feature = "ReadableStreamReaderMode")] #[allow(non_snake_case)] mod gen_ReadableStreamReaderMode; #[cfg(feature = "ReadableStreamReaderMode")] pub use gen_ReadableStreamReaderMode::*; -#[cfg(feature = "ReadableStreamType")] -#[allow(non_snake_case)] -mod gen_ReadableStreamType; -#[cfg(feature = "ReadableStreamType")] -pub use gen_ReadableStreamType::*; - #[cfg(feature = "ReadableWritablePair")] #[allow(non_snake_case)] mod gen_ReadableWritablePair; @@ -7768,18 +7732,6 @@ mod gen_TransformStream; #[cfg(feature = "TransformStream")] pub use gen_TransformStream::*; -#[cfg(feature = "TransformStreamDefaultController")] -#[allow(non_snake_case)] -mod gen_TransformStreamDefaultController; -#[cfg(feature = "TransformStreamDefaultController")] -pub use gen_TransformStreamDefaultController::*; - -#[cfg(feature = "Transformer")] -#[allow(non_snake_case)] -mod gen_Transformer; -#[cfg(feature = "Transformer")] -pub use gen_Transformer::*; - #[cfg(feature = "TransitionEvent")] #[allow(non_snake_case)] mod gen_TransitionEvent; @@ -7858,18 +7810,6 @@ mod gen_UiEventInit; #[cfg(feature = "UiEventInit")] pub use gen_UiEventInit::*; -#[cfg(feature = "UnderlyingSink")] -#[allow(non_snake_case)] -mod gen_UnderlyingSink; -#[cfg(feature = "UnderlyingSink")] -pub use gen_UnderlyingSink::*; - -#[cfg(feature = "UnderlyingSource")] -#[allow(non_snake_case)] -mod gen_UnderlyingSource; -#[cfg(feature = "UnderlyingSource")] -pub use gen_UnderlyingSource::*; - #[cfg(feature = "Url")] #[allow(non_snake_case)] mod gen_Url; @@ -8686,12 +8626,6 @@ mod gen_WritableStream; #[cfg(feature = "WritableStream")] pub use gen_WritableStream::*; -#[cfg(feature = "WritableStreamDefaultController")] -#[allow(non_snake_case)] -mod gen_WritableStreamDefaultController; -#[cfg(feature = "WritableStreamDefaultController")] -pub use gen_WritableStreamDefaultController::*; - #[cfg(feature = "WritableStreamDefaultWriter")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultWriter; diff --git a/crates/web-sys/webidls/enabled/ReadableStream.webidl b/crates/web-sys/webidls/enabled/ReadableStream.webidl new file mode 100644 index 00000000000..00c8bbc8a4a --- /dev/null +++ b/crates/web-sys/webidls/enabled/ReadableStream.webidl @@ -0,0 +1,47 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#rs-class-definition + */ + +[Exposed=(Window,Worker,Worklet), Transferable] +interface ReadableStream { + constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise cancel(optional any reason); + ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); + ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); + Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); + sequence tee(); + + async iterable(optional ReadableStreamIteratorOptions options = {}); +}; + +typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; + +enum ReadableStreamReaderMode { "byob" }; + +dictionary ReadableStreamGetReaderOptions { + ReadableStreamReaderMode mode; +}; + +dictionary ReadableStreamIteratorOptions { + boolean preventCancel = false; +}; + +dictionary ReadableWritablePair { + required ReadableStream readable; + required WritableStream writable; +}; + +dictionary StreamPipeOptions { + boolean preventClose = false; + boolean preventAbort = false; + boolean preventCancel = false; + AbortSignal signal; +}; diff --git a/crates/web-sys/webidls/enabled/Streams.webidl b/crates/web-sys/webidls/enabled/Streams.webidl deleted file mode 100644 index f5d853ff25d..00000000000 --- a/crates/web-sys/webidls/enabled/Streams.webidl +++ /dev/null @@ -1,227 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* Copyright © WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative - * Commons Attribution 4.0 International License. To the extent portions of it are incorporated into - * source code, such portions in the source code are licensed under the BSD 3-Clause License - * instead. - * - * The origin of this IDL file is - * https://streams.spec.whatwg.org/#idl-index - */ - -[Exposed=*, Transferable] -interface ReadableStream { - constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise cancel(optional any reason); - ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); - ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); - Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); - sequence tee(); - - async iterable(optional ReadableStreamIteratorOptions options = {}); -}; - -typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; - -enum ReadableStreamReaderMode { "byob" }; - -dictionary ReadableStreamGetReaderOptions { - ReadableStreamReaderMode mode; -}; - -dictionary ReadableStreamIteratorOptions { - boolean preventCancel = false; -}; - -dictionary ReadableWritablePair { - required ReadableStream readable; - required WritableStream writable; -}; - -dictionary StreamPipeOptions { - boolean preventClose = false; - boolean preventAbort = false; - boolean preventCancel = false; - AbortSignal signal; -}; - -dictionary UnderlyingSource { - UnderlyingSourceStartCallback start; - UnderlyingSourcePullCallback pull; - UnderlyingSourceCancelCallback cancel; - ReadableStreamType type; - [EnforceRange] unsigned long long autoAllocateChunkSize; -}; - -typedef (ReadableStreamDefaultController or ReadableByteStreamController) ReadableStreamController; - -callback UnderlyingSourceStartCallback = any (ReadableStreamController controller); -callback UnderlyingSourcePullCallback = Promise (ReadableStreamController controller); -callback UnderlyingSourceCancelCallback = Promise (optional any reason); - -enum ReadableStreamType { "bytes" }; - -interface mixin ReadableStreamGenericReader { - readonly attribute Promise closed; - - Promise cancel(optional any reason); -}; - -[Exposed=*] -interface ReadableStreamDefaultReader { - constructor(ReadableStream stream); - - Promise read(); - undefined releaseLock(); -}; -ReadableStreamDefaultReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamReadResult { - any value; - boolean done; -}; - -[Exposed=*] -interface ReadableStreamBYOBReader { - constructor(ReadableStream stream); - - Promise read(ArrayBufferView view); - undefined releaseLock(); -}; -ReadableStreamBYOBReader includes ReadableStreamGenericReader; - -[Exposed=*] -interface ReadableStreamDefaultController { - readonly attribute unrestricted double? desiredSize; - - undefined close(); - undefined enqueue(optional any chunk); - undefined error(optional any e); -}; - -[Exposed=*] -interface ReadableByteStreamController { - readonly attribute ReadableStreamBYOBRequest? byobRequest; - readonly attribute unrestricted double? desiredSize; - - undefined close(); - undefined enqueue(ArrayBufferView chunk); - undefined error(optional any e); -}; - -[Exposed=*] -interface ReadableStreamBYOBRequest { - readonly attribute ArrayBufferView? view; - - undefined respond([EnforceRange] unsigned long long bytesWritten); - undefined respondWithNewView(ArrayBufferView view); -}; - -[Exposed=*, Transferable] -interface WritableStream { - constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise abort(optional any reason); - Promise close(); - WritableStreamDefaultWriter getWriter(); -}; - -dictionary UnderlyingSink { - UnderlyingSinkStartCallback start; - UnderlyingSinkWriteCallback write; - UnderlyingSinkCloseCallback close; - UnderlyingSinkAbortCallback abort; - any type; -}; - -callback UnderlyingSinkStartCallback = any (WritableStreamDefaultController controller); -callback UnderlyingSinkWriteCallback = Promise (any chunk, WritableStreamDefaultController controller); -callback UnderlyingSinkCloseCallback = Promise (); -callback UnderlyingSinkAbortCallback = Promise (optional any reason); - -[Exposed=*] -interface WritableStreamDefaultWriter { - constructor(WritableStream stream); - - readonly attribute Promise closed; - readonly attribute unrestricted double? desiredSize; - readonly attribute Promise ready; - - Promise abort(optional any reason); - Promise close(); - undefined releaseLock(); - Promise write(optional any chunk); -}; - -[Exposed=*] -interface WritableStreamDefaultController { - readonly attribute AbortSignal signal; - undefined error(optional any e); -}; - -[Exposed=*, Transferable] -interface TransformStream { - constructor(optional object transformer, - optional QueuingStrategy writableStrategy = {}, - optional QueuingStrategy readableStrategy = {}); - - readonly attribute ReadableStream readable; - readonly attribute WritableStream writable; -}; - -dictionary Transformer { - TransformerStartCallback start; - TransformerTransformCallback transform; - TransformerFlushCallback flush; - any readableType; - any writableType; -}; - -callback TransformerStartCallback = any (TransformStreamDefaultController controller); -callback TransformerFlushCallback = Promise (TransformStreamDefaultController controller); -callback TransformerTransformCallback = Promise (any chunk, TransformStreamDefaultController controller); - -[Exposed=*] -interface TransformStreamDefaultController { - readonly attribute unrestricted double? desiredSize; - - undefined enqueue(optional any chunk); - undefined error(optional any reason); - undefined terminate(); -}; - -dictionary QueuingStrategy { - unrestricted double highWaterMark; - QueuingStrategySize size; -}; - -callback QueuingStrategySize = unrestricted double (any chunk); - -dictionary QueuingStrategyInit { - required unrestricted double highWaterMark; -}; - -[Exposed=*] -interface ByteLengthQueuingStrategy { - constructor(QueuingStrategyInit init); - - readonly attribute unrestricted double highWaterMark; - readonly attribute Function size; -}; - -[Exposed=*] -interface CountQueuingStrategy { - constructor(QueuingStrategyInit init); - - readonly attribute unrestricted double highWaterMark; - readonly attribute Function size; -}; - -interface mixin GenericTransformStream { - readonly attribute ReadableStream readable; - readonly attribute WritableStream writable; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl new file mode 100644 index 00000000000..b8410e2e072 --- /dev/null +++ b/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader + */ + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStreamBYOBReader { + constructor(ReadableStream stream); + + Promise read(ArrayBufferView view); + undefined releaseLock(); +}; +ReadableStreamBYOBReader includes ReadableStreamGenericReader; + +dictionary ReadableStreamBYOBReadResult { + ArrayBufferView value; + boolean done; +}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl new file mode 100644 index 00000000000..076da905c12 --- /dev/null +++ b/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader + */ + +[Exposed=(Window,Worker,Worklet)] +interface ReadableStreamDefaultReader { + constructor(ReadableStream stream); + + Promise read(); + undefined releaseLock(); +}; +ReadableStreamDefaultReader includes ReadableStreamGenericReader; + +dictionary ReadableStreamDefaultReadResult { + any value; + boolean done; +}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl new file mode 100644 index 00000000000..a6c308dad41 --- /dev/null +++ b/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl @@ -0,0 +1,14 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#readablestreamgenericreader + */ + +interface mixin ReadableStreamGenericReader { + readonly attribute Promise closed; + + Promise cancel(optional any reason); +}; diff --git a/crates/web-sys/webidls/unstable/TransformStream.webidl b/crates/web-sys/webidls/unstable/TransformStream.webidl new file mode 100644 index 00000000000..61275a85237 --- /dev/null +++ b/crates/web-sys/webidls/unstable/TransformStream.webidl @@ -0,0 +1,16 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#transformstream + */ + +[Exposed=(Window,Worker,Worklet), Transferable] +interface TransformStream { + constructor(optional object transformer, optional QueuingStrategy writableStrategy = {}, optional QueuingStrategy readableStrategy = {}); + + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; diff --git a/crates/web-sys/webidls/unstable/WritableStream.webidl b/crates/web-sys/webidls/unstable/WritableStream.webidl new file mode 100644 index 00000000000..0eb709ed3c8 --- /dev/null +++ b/crates/web-sys/webidls/unstable/WritableStream.webidl @@ -0,0 +1,19 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#ws-class-definition + */ + +[Exposed=(Window,Worker,Worklet), Transferable] +interface WritableStream { + constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise abort(optional any reason); + Promise close(); + WritableStreamDefaultWriter getWriter(); +}; diff --git a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl b/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl new file mode 100644 index 00000000000..9daa09a3d35 --- /dev/null +++ b/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. + * You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Source: https://streams.spec.whatwg.org/#writablestreamdefaultwriter + */ + +[Exposed=(Window,Worker,Worklet)] +interface WritableStreamDefaultWriter { + constructor(WritableStream stream); + + readonly attribute Promise closed; + readonly attribute unrestricted double? desiredSize; + readonly attribute Promise ready; + + Promise abort(optional any reason); + Promise close(); + undefined releaseLock(); + Promise write(optional any chunk); +}; From 4b6713d50ae1b9dbc240884a2e73be8349f70866 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Sat, 3 Sep 2022 16:35:06 -0400 Subject: [PATCH 02/10] Added full Streams API --- .../webidls/enabled/ReadableStream.webidl | 47 ---- crates/web-sys/webidls/enabled/Streams.webidl | 232 ++++++++++++++++++ .../unstable/ReadableStreamBYOBReader.webidl | 22 -- .../ReadableStreamDefaultReader.webidl | 22 -- .../ReadableStreamGenericReader.webidl | 14 -- .../webidls/unstable/TransformStream.webidl | 16 -- .../webidls/unstable/WritableStream.webidl | 19 -- .../WritableStreamDefaultWriter.webidl | 22 -- 8 files changed, 232 insertions(+), 162 deletions(-) delete mode 100644 crates/web-sys/webidls/enabled/ReadableStream.webidl create mode 100644 crates/web-sys/webidls/enabled/Streams.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/TransformStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/WritableStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl diff --git a/crates/web-sys/webidls/enabled/ReadableStream.webidl b/crates/web-sys/webidls/enabled/ReadableStream.webidl deleted file mode 100644 index 00c8bbc8a4a..00000000000 --- a/crates/web-sys/webidls/enabled/ReadableStream.webidl +++ /dev/null @@ -1,47 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#rs-class-definition - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface ReadableStream { - constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise cancel(optional any reason); - ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); - ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); - Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); - sequence tee(); - - async iterable(optional ReadableStreamIteratorOptions options = {}); -}; - -typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; - -enum ReadableStreamReaderMode { "byob" }; - -dictionary ReadableStreamGetReaderOptions { - ReadableStreamReaderMode mode; -}; - -dictionary ReadableStreamIteratorOptions { - boolean preventCancel = false; -}; - -dictionary ReadableWritablePair { - required ReadableStream readable; - required WritableStream writable; -}; - -dictionary StreamPipeOptions { - boolean preventClose = false; - boolean preventAbort = false; - boolean preventCancel = false; - AbortSignal signal; -}; diff --git a/crates/web-sys/webidls/enabled/Streams.webidl b/crates/web-sys/webidls/enabled/Streams.webidl new file mode 100644 index 00000000000..dcb6bb01042 --- /dev/null +++ b/crates/web-sys/webidls/enabled/Streams.webidl @@ -0,0 +1,232 @@ +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + +/* Copyright © WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a Creative + * Commons Attribution 4.0 International License. To the extent portions of it are incorporated into + * source code, such portions in the source code are licensed under the BSD 3-Clause License + * instead. + * + * The origin of this IDL file is + * https://streams.spec.whatwg.org/#idl-index + * `[Throws]` attributes copied from Mozilla's webidl tree as of Aug. 31, 2022 + * https://hg.mozilla.org/mozilla-central/file/tip/dom/webidl/ + * To avoid API breakage, `[Throws]` attributes are ommitted from `ReadableStream` methods + */ + +[Exposed=*, Transferable] +interface ReadableStream { + constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + Promise cancel(optional any reason); + ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); + ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); + Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); + sequence tee(); + + async iterable(optional ReadableStreamIteratorOptions options = {}); +}; + +typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; + +enum ReadableStreamReaderMode { "byob" }; + +dictionary ReadableStreamGetReaderOptions { + ReadableStreamReaderMode mode; +}; + +dictionary ReadableStreamIteratorOptions { + boolean preventCancel = false; +}; + +dictionary ReadableWritablePair { + required ReadableStream readable; + required WritableStream writable; +}; + +dictionary StreamPipeOptions { + boolean preventClose = false; + boolean preventAbort = false; + boolean preventCancel = false; + AbortSignal signal; +}; + +dictionary UnderlyingSource { + UnderlyingSourceStartCallback start; + UnderlyingSourcePullCallback pull; + UnderlyingSourceCancelCallback cancel; + ReadableStreamType type; + [EnforceRange] unsigned long long autoAllocateChunkSize; +}; + +typedef (ReadableStreamDefaultController or ReadableByteStreamController) ReadableStreamController; + +callback UnderlyingSourceStartCallback = any (ReadableStreamController controller); +callback UnderlyingSourcePullCallback = Promise (ReadableStreamController controller); +callback UnderlyingSourceCancelCallback = Promise (optional any reason); + +enum ReadableStreamType { "bytes" }; + +interface mixin ReadableStreamGenericReader { + readonly attribute Promise closed; + + Promise cancel(optional any reason); +}; + +[Exposed=*] +interface ReadableStreamDefaultReader { + [Throws] constructor(ReadableStream stream); + + Promise read(); + [Throws] undefined releaseLock(); +}; +ReadableStreamDefaultReader includes ReadableStreamGenericReader; + +dictionary ReadableStreamReadResult { + any value; + boolean done; +}; + +[Exposed=*] +interface ReadableStreamBYOBReader { + [Throws] constructor(ReadableStream stream); + + Promise read(ArrayBufferView view); + [Throws] undefined releaseLock(); +}; +ReadableStreamBYOBReader includes ReadableStreamGenericReader; + +[Exposed=*] +interface ReadableStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + + [Throws] undefined close(); + [Throws] undefined enqueue(optional any chunk); + [Throws] undefined error(optional any e); +}; + +[Exposed=*] +interface ReadableByteStreamController { + [Throws] readonly attribute ReadableStreamBYOBRequest? byobRequest; + readonly attribute unrestricted double? desiredSize; + + [Throws] undefined close(); + [Throws] undefined enqueue(ArrayBufferView chunk); + [Throws] undefined error(optional any e); +}; + +[Exposed=*] +interface ReadableStreamBYOBRequest { + readonly attribute ArrayBufferView? view; + + [Throws] undefined respond([EnforceRange] unsigned long long bytesWritten); + [Throws] undefined respondWithNewView(ArrayBufferView view); +}; + +[Exposed=*, Transferable] +interface WritableStream { + [Throws] constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); + + readonly attribute boolean locked; + + [Throws] Promise abort(optional any reason); + Promise close(); + [Throws] WritableStreamDefaultWriter getWriter(); +}; + +dictionary UnderlyingSink { + UnderlyingSinkStartCallback start; + UnderlyingSinkWriteCallback write; + UnderlyingSinkCloseCallback close; + UnderlyingSinkAbortCallback abort; + any type; +}; + +callback UnderlyingSinkStartCallback = any (WritableStreamDefaultController controller); +callback UnderlyingSinkWriteCallback = Promise (any chunk, WritableStreamDefaultController controller); +callback UnderlyingSinkCloseCallback = Promise (); +callback UnderlyingSinkAbortCallback = Promise (optional any reason); + +[Exposed=*] +interface WritableStreamDefaultWriter { + [Throws] constructor(WritableStream stream); + + readonly attribute Promise closed; + [Throws] readonly attribute unrestricted double? desiredSize; + readonly attribute Promise ready; + + [Throws] Promise abort(optional any reason); + Promise close(); + [Throws] undefined releaseLock(); + Promise write(optional any chunk); +}; + +[Exposed=*] +interface WritableStreamDefaultController { + readonly attribute AbortSignal signal; + [Throws] undefined error(optional any e); +}; + +[Exposed=*, Transferable] +interface TransformStream { + [Throws] + constructor(optional object transformer, + optional QueuingStrategy writableStrategy = {}, + optional QueuingStrategy readableStrategy = {}); + + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; + +dictionary Transformer { + TransformerStartCallback start; + TransformerTransformCallback transform; + TransformerFlushCallback flush; + any readableType; + any writableType; +}; + +callback TransformerStartCallback = any (TransformStreamDefaultController controller); +callback TransformerFlushCallback = Promise (TransformStreamDefaultController controller); +callback TransformerTransformCallback = Promise (any chunk, TransformStreamDefaultController controller); + +[Exposed=*] +interface TransformStreamDefaultController { + readonly attribute unrestricted double? desiredSize; + + [Throws] undefined enqueue(optional any chunk); + [Throws] undefined error(optional any reason); + [Throws] undefined terminate(); +}; + +dictionary QueuingStrategy { + unrestricted double highWaterMark; + QueuingStrategySize size; +}; + +callback QueuingStrategySize = unrestricted double (any chunk); + +dictionary QueuingStrategyInit { + required unrestricted double highWaterMark; +}; + +[Exposed=*] +interface ByteLengthQueuingStrategy { + constructor(QueuingStrategyInit init); + + readonly attribute unrestricted double highWaterMark; + [Throws] readonly attribute Function size; +}; + +[Exposed=*] +interface CountQueuingStrategy { + constructor(QueuingStrategyInit init); + + readonly attribute unrestricted double highWaterMark; + [Throws] readonly attribute Function size; +}; + +interface mixin GenericTransformStream { + readonly attribute ReadableStream readable; + readonly attribute WritableStream writable; +}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl deleted file mode 100644 index b8410e2e072..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader - */ - -[Exposed=(Window,Worker,Worklet)] -interface ReadableStreamBYOBReader { - constructor(ReadableStream stream); - - Promise read(ArrayBufferView view); - undefined releaseLock(); -}; -ReadableStreamBYOBReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamBYOBReadResult { - ArrayBufferView value; - boolean done; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl deleted file mode 100644 index 076da905c12..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader - */ - -[Exposed=(Window,Worker,Worklet)] -interface ReadableStreamDefaultReader { - constructor(ReadableStream stream); - - Promise read(); - undefined releaseLock(); -}; -ReadableStreamDefaultReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamDefaultReadResult { - any value; - boolean done; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl deleted file mode 100644 index a6c308dad41..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamgenericreader - */ - -interface mixin ReadableStreamGenericReader { - readonly attribute Promise closed; - - Promise cancel(optional any reason); -}; diff --git a/crates/web-sys/webidls/unstable/TransformStream.webidl b/crates/web-sys/webidls/unstable/TransformStream.webidl deleted file mode 100644 index 61275a85237..00000000000 --- a/crates/web-sys/webidls/unstable/TransformStream.webidl +++ /dev/null @@ -1,16 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#transformstream - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface TransformStream { - constructor(optional object transformer, optional QueuingStrategy writableStrategy = {}, optional QueuingStrategy readableStrategy = {}); - - readonly attribute ReadableStream readable; - readonly attribute WritableStream writable; -}; diff --git a/crates/web-sys/webidls/unstable/WritableStream.webidl b/crates/web-sys/webidls/unstable/WritableStream.webidl deleted file mode 100644 index 0eb709ed3c8..00000000000 --- a/crates/web-sys/webidls/unstable/WritableStream.webidl +++ /dev/null @@ -1,19 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#ws-class-definition - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface WritableStream { - constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise abort(optional any reason); - Promise close(); - WritableStreamDefaultWriter getWriter(); -}; diff --git a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl b/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl deleted file mode 100644 index 9daa09a3d35..00000000000 --- a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#writablestreamdefaultwriter - */ - -[Exposed=(Window,Worker,Worklet)] -interface WritableStreamDefaultWriter { - constructor(WritableStream stream); - - readonly attribute Promise closed; - readonly attribute unrestricted double? desiredSize; - readonly attribute Promise ready; - - Promise abort(optional any reason); - Promise close(); - undefined releaseLock(); - Promise write(optional any chunk); -}; From 9bd95adb8327241c0384cd8715a6f34a19fbf48c Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Sat, 3 Sep 2022 16:44:15 -0400 Subject: [PATCH 03/10] Regenerated web-sys files --- .../features/gen_ByteLengthQueuingStrategy.rs | 36 ++++++ .../src/features/gen_CountQueuingStrategy.rs | 36 ++++++ .../src/features/gen_QueuingStrategyInit.rs | 40 +++++++ .../gen_ReadableByteStreamController.rs | 75 +++++++++++++ .../src/features/gen_ReadableStream.rs | 8 -- .../gen_ReadableStreamByobReadResult.rs | 70 ------------ .../features/gen_ReadableStreamByobReader.rs | 36 +----- .../features/gen_ReadableStreamByobRequest.rs | 61 ++++++++++ .../gen_ReadableStreamDefaultController.rs | 62 +++++++++++ .../gen_ReadableStreamDefaultReadResult.rs | 70 ------------ .../gen_ReadableStreamDefaultReader.rs | 32 +----- .../features/gen_ReadableStreamReadResult.rs | 53 +++++++++ .../src/features/gen_ReadableStreamType.rs | 10 ++ .../src/features/gen_ReadableWritablePair.rs | 8 -- .../src/features/gen_TransformStream.rs | 12 -- .../gen_TransformStreamDefaultController.rs | 62 +++++++++++ .../web-sys/src/features/gen_Transformer.rs | 104 ++++++++++++++++++ .../src/features/gen_UnderlyingSink.rs | 92 ++++++++++++++++ .../src/features/gen_UnderlyingSource.rs | 98 +++++++++++++++++ .../src/features/gen_WritableStream.rs | 36 +----- .../gen_WritableStreamDefaultController.rs | 39 +++++++ .../gen_WritableStreamDefaultWriter.rs | 60 ++-------- crates/web-sys/src/features/mod.rs | 86 +++++++++++++-- 23 files changed, 862 insertions(+), 324 deletions(-) create mode 100644 crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs create mode 100644 crates/web-sys/src/features/gen_CountQueuingStrategy.rs create mode 100644 crates/web-sys/src/features/gen_QueuingStrategyInit.rs create mode 100644 crates/web-sys/src/features/gen_ReadableByteStreamController.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamType.rs create mode 100644 crates/web-sys/src/features/gen_TransformStreamDefaultController.rs create mode 100644 crates/web-sys/src/features/gen_Transformer.rs create mode 100644 crates/web-sys/src/features/gen_UnderlyingSink.rs create mode 100644 crates/web-sys/src/features/gen_UnderlyingSource.rs create mode 100644 crates/web-sys/src/features/gen_WritableStreamDefaultController.rs diff --git a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs new file mode 100644 index 00000000000..723de2d17c7 --- /dev/null +++ b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ByteLengthQueuingStrategy , typescript_type = "ByteLengthQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ByteLengthQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub type ByteLengthQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn high_water_mark(this: &ByteLengthQueuingStrategy) -> f64; + # [wasm_bindgen (structural , catch , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn size(this: &ByteLengthQueuingStrategy) -> Result<::js_sys::Function, JsValue>; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "ByteLengthQueuingStrategy")] + #[doc = "The `new ByteLengthQueuingStrategy(..)` constructor, creating a new instance of `ByteLengthQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs new file mode 100644 index 00000000000..069462f76c3 --- /dev/null +++ b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CountQueuingStrategy , typescript_type = "CountQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CountQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub type CountQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn high_water_mark(this: &CountQueuingStrategy) -> f64; + # [wasm_bindgen (structural , catch , method , getter , js_class = "CountQueuingStrategy" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn size(this: &CountQueuingStrategy) -> Result<::js_sys::Function, JsValue>; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "CountQueuingStrategy")] + #[doc = "The `new CountQueuingStrategy(..)` constructor, creating a new instance of `CountQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs new file mode 100644 index 00000000000..89141292fbc --- /dev/null +++ b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs @@ -0,0 +1,40 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategyInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `QueuingStrategyInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub type QueuingStrategyInit; +} +impl QueuingStrategyInit { + #[doc = "Construct a new `QueuingStrategyInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn new(high_water_mark: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.high_water_mark(high_water_mark); + ret + } + #[doc = "Change the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn high_water_mark(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("highWaterMark"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs new file mode 100644 index 00000000000..a82cd149bf8 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs @@ -0,0 +1,75 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableByteStreamController , typescript_type = "ReadableByteStreamController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableByteStreamController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub type ReadableByteStreamController; + #[cfg(feature = "ReadableStreamByobRequest")] + # [wasm_bindgen (structural , catch , method , getter , js_class = "ReadableByteStreamController" , js_name = byobRequest)] + #[doc = "Getter for the `byobRequest` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/byobRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`, `ReadableStreamByobRequest`*"] + pub fn byob_request( + this: &ReadableByteStreamController, + ) -> Result, JsValue>; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn desired_size(this: &ReadableByteStreamController) -> Option; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn close(this: &ReadableByteStreamController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_array_buffer_view( + this: &ReadableByteStreamController, + chunk: &::js_sys::Object, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn enqueue_with_u8_array( + this: &ReadableByteStreamController, + chunk: &mut [u8], + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn error(this: &ReadableByteStreamController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] + pub fn error_with_e( + this: &ReadableByteStreamController, + e: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_ReadableStream.rs b/crates/web-sys/src/features/gen_ReadableStream.rs index a68f982b964..c66b913be9e 100644 --- a/crates/web-sys/src/features/gen_ReadableStream.rs +++ b/crates/web-sys/src/features/gen_ReadableStream.rs @@ -112,7 +112,6 @@ extern "C" { transform: &ReadableWritablePair, options: &StreamPipeOptions, ) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -120,11 +119,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -132,9 +127,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to_with_options( this: &ReadableStream, destination: &WritableStream, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs deleted file mode 100644 index eb58aeca844..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamByobReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamByobReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamByobReadResult { - #[doc = "Construct a new `ReadableStreamByobReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -#[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamByobReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs index a630495bad7..71bf4c35ce7 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReader , typescript_type = "ReadableStreamBYOBReader")] @@ -11,22 +10,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamByobReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamBYOBReader")] #[doc = "The `new ReadableStreamByobReader(..)` constructor, creating a new instance of `ReadableStreamByobReader`."] @@ -34,70 +25,47 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_array_buffer_view( this: &ReadableStreamByobReader, view: &::js_sys::Object, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_u8_array( this: &ReadableStreamByobReader, view: &mut [u8], ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn release_lock(this: &ReadableStreamByobReader); - #[cfg(web_sys_unstable_apis)] + pub fn release_lock(this: &ReadableStreamByobReader) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamByobReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs new file mode 100644 index 00000000000..7638c598d1b --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamByobRequest.rs @@ -0,0 +1,61 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBRequest , typescript_type = "ReadableStreamBYOBRequest")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamByobRequest` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub type ReadableStreamByobRequest; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBRequest" , js_name = view)] + #[doc = "Getter for the `view` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/view)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn view(this: &ReadableStreamByobRequest) -> Option<::js_sys::Object>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] + #[doc = "The `respond()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_u32( + this: &ReadableStreamByobRequest, + bytes_written: u32, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respond)] + #[doc = "The `respond()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respond)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_f64( + this: &ReadableStreamByobRequest, + bytes_written: f64, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_array_buffer_view( + this: &ReadableStreamByobRequest, + view: &::js_sys::Object, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBRequest" , js_name = respondWithNewView)] + #[doc = "The `respondWithNewView()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBRequest/respondWithNewView)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobRequest`*"] + pub fn respond_with_new_view_with_u8_array( + this: &ReadableStreamByobRequest, + view: &mut [u8], + ) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs new file mode 100644 index 00000000000..436f26a9eee --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs @@ -0,0 +1,62 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultController , typescript_type = "ReadableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub type ReadableStreamDefaultController; + # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn desired_size(this: &ReadableStreamDefaultController) -> Option; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = close)] + #[doc = "The `close()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/close)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn close(this: &ReadableStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn enqueue(this: &ReadableStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn enqueue_with_chunk( + this: &ReadableStreamDefaultController, + chunk: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn error(this: &ReadableStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] + pub fn error_with_e( + this: &ReadableStreamDefaultController, + e: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs deleted file mode 100644 index 82bbf8ca1e1..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamDefaultReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamDefaultReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamDefaultReadResult { - #[doc = "Construct a new `ReadableStreamDefaultReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -#[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamDefaultReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs index e47c2a3073f..f8f9731126f 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReader , typescript_type = "ReadableStreamDefaultReader")] @@ -11,22 +10,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamDefaultReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamDefaultReader")] #[doc = "The `new ReadableStreamDefaultReader(..)` constructor, creating a new instance of `ReadableStreamDefaultReader`."] @@ -34,53 +25,34 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] + # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn release_lock(this: &ReadableStreamDefaultReader); - #[cfg(web_sys_unstable_apis)] + pub fn release_lock(this: &ReadableStreamDefaultReader) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamDefaultReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs new file mode 100644 index 00000000000..794dc0e9b0a --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs @@ -0,0 +1,53 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamReadResult)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamReadResult` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub type ReadableStreamReadResult; +} +impl ReadableStreamReadResult { + #[doc = "Construct a new `ReadableStreamReadResult`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn done(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for ReadableStreamReadResult { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamType.rs b/crates/web-sys/src/features/gen_ReadableStreamType.rs new file mode 100644 index 00000000000..5bbe4467f36 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamType.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `ReadableStreamType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ReadableStreamType { + Bytes = "bytes", +} diff --git a/crates/web-sys/src/features/gen_ReadableWritablePair.rs b/crates/web-sys/src/features/gen_ReadableWritablePair.rs index 0ce861e74ab..8a34d98aca5 100644 --- a/crates/web-sys/src/features/gen_ReadableWritablePair.rs +++ b/crates/web-sys/src/features/gen_ReadableWritablePair.rs @@ -11,14 +11,10 @@ extern "C" { pub type ReadableWritablePair; } impl ReadableWritablePair { - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "ReadableStream", feature = "WritableStream",))] #[doc = "Construct a new `ReadableWritablePair`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(readable: &ReadableStream, writable: &WritableStream) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); @@ -44,14 +40,10 @@ impl ReadableWritablePair { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[doc = "Change the `writable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(&mut self, val: &WritableStream) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( diff --git a/crates/web-sys/src/features/gen_TransformStream.rs b/crates/web-sys/src/features/gen_TransformStream.rs index d2a041a700c..9dd64d45d33 100644 --- a/crates/web-sys/src/features/gen_TransformStream.rs +++ b/crates/web-sys/src/features/gen_TransformStream.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStream , typescript_type = "TransformStream")] @@ -11,11 +10,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type TransformStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] #[doc = "Getter for the `readable` field of this object."] @@ -23,11 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn readable(this: &TransformStream) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] #[doc = "Getter for the `writable` field of this object."] @@ -35,9 +26,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(this: &TransformStream) -> WritableStream; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] diff --git a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs new file mode 100644 index 00000000000..7c0796d4c4d --- /dev/null +++ b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs @@ -0,0 +1,62 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStreamDefaultController , typescript_type = "TransformStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `TransformStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub type TransformStreamDefaultController; + # [wasm_bindgen (structural , method , getter , js_class = "TransformStreamDefaultController" , js_name = desiredSize)] + #[doc = "Getter for the `desiredSize` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/desiredSize)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn desired_size(this: &TransformStreamDefaultController) -> Option; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn enqueue(this: &TransformStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = enqueue)] + #[doc = "The `enqueue()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/enqueue)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn enqueue_with_chunk( + this: &TransformStreamDefaultController, + chunk: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn error(this: &TransformStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn error_with_reason( + this: &TransformStreamDefaultController, + reason: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] + #[doc = "The `terminate()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/terminate)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] + pub fn terminate(this: &TransformStreamDefaultController) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_Transformer.rs b/crates/web-sys/src/features/gen_Transformer.rs new file mode 100644 index 00000000000..c0dddae0727 --- /dev/null +++ b/crates/web-sys/src/features/gen_Transformer.rs @@ -0,0 +1,104 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Transformer)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Transformer` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub type Transformer; +} +impl Transformer { + #[doc = "Construct a new `Transformer`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn flush(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flush"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `readableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn readable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("readableType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `transform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn transform(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("transform"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `writableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn writable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("writableType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for Transformer { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSink.rs b/crates/web-sys/src/features/gen_UnderlyingSink.rs new file mode 100644 index 00000000000..dd69488671c --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSink.rs @@ -0,0 +1,92 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSink)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSink` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub type UnderlyingSink; +} +impl UnderlyingSink { + #[doc = "Construct a new `UnderlyingSink`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `abort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn abort(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("abort"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `close` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn close(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("close"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn type_(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn write(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("write"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for UnderlyingSink { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSource.rs b/crates/web-sys/src/features/gen_UnderlyingSource.rs new file mode 100644 index 00000000000..a6a90943179 --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSource.rs @@ -0,0 +1,98 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSource)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSource` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub type UnderlyingSource; +} +impl UnderlyingSource { + #[doc = "Construct a new `UnderlyingSource`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `autoAllocateChunkSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("autoAllocateChunkSize"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `cancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cancel"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `pull` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pull"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "ReadableStreamType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"] + pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for UnderlyingSource { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index 7f9ed141e58..833d2ca1483 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStream , typescript_type = "WritableStream")] @@ -11,20 +10,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStream; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] #[doc = "Getter for the `locked` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn locked(this: &WritableStream) -> bool; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] @@ -65,52 +57,36 @@ extern "C" { underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, ) -> Result; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] + # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn abort(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] + pub fn abort(this: &WritableStream) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStream, reason: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] + ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStreamDefaultWriter")] - # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = getWriter)] + # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = getWriter)] #[doc = "The `getWriter()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn get_writer(this: &WritableStream) -> WritableStreamDefaultWriter; + pub fn get_writer(this: &WritableStream) -> Result; } diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs new file mode 100644 index 00000000000..05a37cf10ca --- /dev/null +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs @@ -0,0 +1,39 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultController , typescript_type = "WritableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WritableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub type WritableStreamDefaultController; + #[cfg(feature = "AbortSignal")] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultController" , js_name = signal)] + #[doc = "Getter for the `signal` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/signal)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WritableStreamDefaultController`*"] + pub fn signal(this: &WritableStreamDefaultController) -> AbortSignal; + # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error(this: &WritableStreamDefaultController) -> Result<(), JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error_with_e( + this: &WritableStreamDefaultController, + e: &::wasm_bindgen::JsValue, + ) -> Result<(), JsValue>; +} diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index 1ba5bd8b6ce..95ddb072c05 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultWriter , typescript_type = "WritableStreamDefaultWriter")] @@ -11,44 +10,28 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStreamDefaultWriter; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] + # [wasm_bindgen (structural , catch , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] #[doc = "Getter for the `desiredSize` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/desiredSize)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn desired_size(this: &WritableStreamDefaultWriter) -> Option; - #[cfg(web_sys_unstable_apis)] + pub fn desired_size(this: &WritableStreamDefaultWriter) -> Result, JsValue>; # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = ready)] #[doc = "Getter for the `ready` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/ready)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] @@ -56,78 +39,51 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &WritableStream) -> Result; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] + # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] + pub fn abort(this: &WritableStreamDefaultWriter) -> Result<::js_sys::Promise, JsValue>; + # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStreamDefaultWriter, reason: &::wasm_bindgen::JsValue, - ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] + ) -> Result<::js_sys::Promise, JsValue>; # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] - # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] + # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn release_lock(this: &WritableStreamDefaultWriter); - #[cfg(web_sys_unstable_apis)] + pub fn release_lock(this: &WritableStreamDefaultWriter) -> Result<(), JsValue>; # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_chunk( this: &WritableStreamDefaultWriter, chunk: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 59d6818792d..dfb2a94cac1 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -718,6 +718,12 @@ mod gen_BrowserFindDirection; #[cfg(feature = "BrowserFindDirection")] pub use gen_BrowserFindDirection::*; +#[cfg(feature = "ByteLengthQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_ByteLengthQueuingStrategy; +#[cfg(feature = "ByteLengthQueuingStrategy")] +pub use gen_ByteLengthQueuingStrategy::*; + #[cfg(feature = "Cache")] #[allow(non_snake_case)] mod gen_Cache; @@ -1156,6 +1162,12 @@ mod gen_Coordinates; #[cfg(feature = "Coordinates")] pub use gen_Coordinates::*; +#[cfg(feature = "CountQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_CountQueuingStrategy; +#[cfg(feature = "CountQueuingStrategy")] +pub use gen_CountQueuingStrategy::*; + #[cfg(feature = "Credential")] #[allow(non_snake_case)] mod gen_Credential; @@ -5656,6 +5668,12 @@ mod gen_QueuingStrategy; #[cfg(feature = "QueuingStrategy")] pub use gen_QueuingStrategy::*; +#[cfg(feature = "QueuingStrategyInit")] +#[allow(non_snake_case)] +mod gen_QueuingStrategyInit; +#[cfg(feature = "QueuingStrategyInit")] +pub use gen_QueuingStrategyInit::*; + #[cfg(feature = "RadioNodeList")] #[allow(non_snake_case)] mod gen_RadioNodeList; @@ -5680,29 +5698,35 @@ mod gen_RcwnStatus; #[cfg(feature = "RcwnStatus")] pub use gen_RcwnStatus::*; +#[cfg(feature = "ReadableByteStreamController")] +#[allow(non_snake_case)] +mod gen_ReadableByteStreamController; +#[cfg(feature = "ReadableByteStreamController")] +pub use gen_ReadableByteStreamController::*; + #[cfg(feature = "ReadableStream")] #[allow(non_snake_case)] mod gen_ReadableStream; #[cfg(feature = "ReadableStream")] pub use gen_ReadableStream::*; -#[cfg(feature = "ReadableStreamByobReadResult")] -#[allow(non_snake_case)] -mod gen_ReadableStreamByobReadResult; -#[cfg(feature = "ReadableStreamByobReadResult")] -pub use gen_ReadableStreamByobReadResult::*; - #[cfg(feature = "ReadableStreamByobReader")] #[allow(non_snake_case)] mod gen_ReadableStreamByobReader; #[cfg(feature = "ReadableStreamByobReader")] pub use gen_ReadableStreamByobReader::*; -#[cfg(feature = "ReadableStreamDefaultReadResult")] +#[cfg(feature = "ReadableStreamByobRequest")] #[allow(non_snake_case)] -mod gen_ReadableStreamDefaultReadResult; -#[cfg(feature = "ReadableStreamDefaultReadResult")] -pub use gen_ReadableStreamDefaultReadResult::*; +mod gen_ReadableStreamByobRequest; +#[cfg(feature = "ReadableStreamByobRequest")] +pub use gen_ReadableStreamByobRequest::*; + +#[cfg(feature = "ReadableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_ReadableStreamDefaultController; +#[cfg(feature = "ReadableStreamDefaultController")] +pub use gen_ReadableStreamDefaultController::*; #[cfg(feature = "ReadableStreamDefaultReader")] #[allow(non_snake_case)] @@ -5722,12 +5746,24 @@ mod gen_ReadableStreamIteratorOptions; #[cfg(feature = "ReadableStreamIteratorOptions")] pub use gen_ReadableStreamIteratorOptions::*; +#[cfg(feature = "ReadableStreamReadResult")] +#[allow(non_snake_case)] +mod gen_ReadableStreamReadResult; +#[cfg(feature = "ReadableStreamReadResult")] +pub use gen_ReadableStreamReadResult::*; + #[cfg(feature = "ReadableStreamReaderMode")] #[allow(non_snake_case)] mod gen_ReadableStreamReaderMode; #[cfg(feature = "ReadableStreamReaderMode")] pub use gen_ReadableStreamReaderMode::*; +#[cfg(feature = "ReadableStreamType")] +#[allow(non_snake_case)] +mod gen_ReadableStreamType; +#[cfg(feature = "ReadableStreamType")] +pub use gen_ReadableStreamType::*; + #[cfg(feature = "ReadableWritablePair")] #[allow(non_snake_case)] mod gen_ReadableWritablePair; @@ -7732,6 +7768,18 @@ mod gen_TransformStream; #[cfg(feature = "TransformStream")] pub use gen_TransformStream::*; +#[cfg(feature = "TransformStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_TransformStreamDefaultController; +#[cfg(feature = "TransformStreamDefaultController")] +pub use gen_TransformStreamDefaultController::*; + +#[cfg(feature = "Transformer")] +#[allow(non_snake_case)] +mod gen_Transformer; +#[cfg(feature = "Transformer")] +pub use gen_Transformer::*; + #[cfg(feature = "TransitionEvent")] #[allow(non_snake_case)] mod gen_TransitionEvent; @@ -7810,6 +7858,18 @@ mod gen_UiEventInit; #[cfg(feature = "UiEventInit")] pub use gen_UiEventInit::*; +#[cfg(feature = "UnderlyingSink")] +#[allow(non_snake_case)] +mod gen_UnderlyingSink; +#[cfg(feature = "UnderlyingSink")] +pub use gen_UnderlyingSink::*; + +#[cfg(feature = "UnderlyingSource")] +#[allow(non_snake_case)] +mod gen_UnderlyingSource; +#[cfg(feature = "UnderlyingSource")] +pub use gen_UnderlyingSource::*; + #[cfg(feature = "Url")] #[allow(non_snake_case)] mod gen_Url; @@ -8626,6 +8686,12 @@ mod gen_WritableStream; #[cfg(feature = "WritableStream")] pub use gen_WritableStream::*; +#[cfg(feature = "WritableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_WritableStreamDefaultController; +#[cfg(feature = "WritableStreamDefaultController")] +pub use gen_WritableStreamDefaultController::*; + #[cfg(feature = "WritableStreamDefaultWriter")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultWriter; From 46c450cb5fc1c7924bf58ef295d656b2b3c84678 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Sat, 3 Sep 2022 17:15:38 -0400 Subject: [PATCH 04/10] Updated Cargo.toml features --- crates/web-sys/Cargo.toml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/crates/web-sys/Cargo.toml b/crates/web-sys/Cargo.toml index 2dd34862c4b..b0d7067a826 100644 --- a/crates/web-sys/Cargo.toml +++ b/crates/web-sys/Cargo.toml @@ -150,6 +150,7 @@ BrowserElementExecuteScriptOptions = [] BrowserFeedWriter = [] BrowserFindCaseSensitivity = [] BrowserFindDirection = [] +ByteLengthQueuingStrategy = [] Cache = [] CacheBatchOperation = [] CacheQueryOptions = [] @@ -223,6 +224,7 @@ ConvertCoordinateOptions = [] ConvolverNode = ["AudioNode", "EventTarget"] ConvolverOptions = [] Coordinates = [] +CountQueuingStrategy = [] Credential = [] CredentialCreationOptions = [] CredentialRequestOptions = [] @@ -973,18 +975,22 @@ PushSubscriptionKeys = [] PushSubscriptionOptions = [] PushSubscriptionOptionsInit = [] QueuingStrategy = [] +QueuingStrategyInit = [] RadioNodeList = ["NodeList"] Range = [] RcwnPerfStats = [] RcwnStatus = [] +ReadableByteStreamController = [] ReadableStream = [] -ReadableStreamByobReadResult = [] ReadableStreamByobReader = [] -ReadableStreamDefaultReadResult = [] +ReadableStreamByobRequest = [] +ReadableStreamDefaultController = [] ReadableStreamDefaultReader = [] ReadableStreamGetReaderOptions = [] ReadableStreamIteratorOptions = [] +ReadableStreamReadResult = [] ReadableStreamReaderMode = [] +ReadableStreamType = [] ReadableWritablePair = [] RecordingState = [] ReferrerPolicy = [] @@ -1319,6 +1325,8 @@ TouchList = [] TrackEvent = ["Event"] TrackEventInit = [] TransformStream = [] +TransformStreamDefaultController = [] +Transformer = [] TransitionEvent = ["Event"] TransitionEventInit = [] Transport = [] @@ -1332,6 +1340,8 @@ UdpMessageEventInit = [] UdpOptions = [] UiEvent = ["Event"] UiEventInit = [] +UnderlyingSink = [] +UnderlyingSource = [] Url = [] UrlSearchParams = [] Usb = ["EventTarget"] @@ -1468,6 +1478,7 @@ Worklet = [] WorkletGlobalScope = [] WorkletOptions = [] WritableStream = [] +WritableStreamDefaultController = [] WritableStreamDefaultWriter = [] XPathExpression = [] XPathNsResolver = [] From 88b2dd7573ce9428dd650b005dd06af87ae1bd97 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 5 Sep 2022 00:43:48 -0400 Subject: [PATCH 05/10] Removed unnecessary [Throws] --- crates/web-sys/webidls/enabled/Streams.webidl | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/web-sys/webidls/enabled/Streams.webidl b/crates/web-sys/webidls/enabled/Streams.webidl index dcb6bb01042..c283b4e7e3f 100644 --- a/crates/web-sys/webidls/enabled/Streams.webidl +++ b/crates/web-sys/webidls/enabled/Streams.webidl @@ -7,9 +7,9 @@ * * The origin of this IDL file is * https://streams.spec.whatwg.org/#idl-index - * `[Throws]` attributes copied from Mozilla's webidl tree as of Aug. 31, 2022 - * https://hg.mozilla.org/mozilla-central/file/tip/dom/webidl/ - * To avoid API breakage, `[Throws]` attributes are ommitted from `ReadableStream` methods + * `[Throws]` attribute for each method was determined by manually checking if the method can throw + * an exception according to the spec. + * To avoid API breakage, `[Throws]` attributes are omitted from `ReadableStream` methods. */ [Exposed=*, Transferable] @@ -78,7 +78,7 @@ interface ReadableStreamDefaultReader { [Throws] constructor(ReadableStream stream); Promise read(); - [Throws] undefined releaseLock(); + undefined releaseLock(); }; ReadableStreamDefaultReader includes ReadableStreamGenericReader; @@ -92,7 +92,7 @@ interface ReadableStreamBYOBReader { [Throws] constructor(ReadableStream stream); Promise read(ArrayBufferView view); - [Throws] undefined releaseLock(); + undefined releaseLock(); }; ReadableStreamBYOBReader includes ReadableStreamGenericReader; @@ -102,17 +102,17 @@ interface ReadableStreamDefaultController { [Throws] undefined close(); [Throws] undefined enqueue(optional any chunk); - [Throws] undefined error(optional any e); + undefined error(optional any e); }; [Exposed=*] interface ReadableByteStreamController { - [Throws] readonly attribute ReadableStreamBYOBRequest? byobRequest; + readonly attribute ReadableStreamBYOBRequest? byobRequest; readonly attribute unrestricted double? desiredSize; [Throws] undefined close(); [Throws] undefined enqueue(ArrayBufferView chunk); - [Throws] undefined error(optional any e); + undefined error(optional any e); }; [Exposed=*] @@ -129,7 +129,7 @@ interface WritableStream { readonly attribute boolean locked; - [Throws] Promise abort(optional any reason); + Promise abort(optional any reason); Promise close(); [Throws] WritableStreamDefaultWriter getWriter(); }; @@ -155,16 +155,16 @@ interface WritableStreamDefaultWriter { [Throws] readonly attribute unrestricted double? desiredSize; readonly attribute Promise ready; - [Throws] Promise abort(optional any reason); + Promise abort(optional any reason); Promise close(); - [Throws] undefined releaseLock(); + undefined releaseLock(); Promise write(optional any chunk); }; [Exposed=*] interface WritableStreamDefaultController { readonly attribute AbortSignal signal; - [Throws] undefined error(optional any e); + undefined error(optional any e); }; [Exposed=*, Transferable] @@ -195,7 +195,7 @@ interface TransformStreamDefaultController { readonly attribute unrestricted double? desiredSize; [Throws] undefined enqueue(optional any chunk); - [Throws] undefined error(optional any reason); + undefined error(optional any reason); [Throws] undefined terminate(); }; @@ -215,7 +215,7 @@ interface ByteLengthQueuingStrategy { constructor(QueuingStrategyInit init); readonly attribute unrestricted double highWaterMark; - [Throws] readonly attribute Function size; + readonly attribute Function size; }; [Exposed=*] @@ -223,7 +223,7 @@ interface CountQueuingStrategy { constructor(QueuingStrategyInit init); readonly attribute unrestricted double highWaterMark; - [Throws] readonly attribute Function size; + readonly attribute Function size; }; interface mixin GenericTransformStream { From d7211f432f3a54690cc116415782f72cf5c0149b Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 5 Sep 2022 00:46:31 -0400 Subject: [PATCH 06/10] Regenerated web-sys files --- .../features/gen_ByteLengthQueuingStrategy.rs | 4 ++-- .../src/features/gen_CountQueuingStrategy.rs | 4 ++-- .../gen_ReadableByteStreamController.rs | 17 ++++++----------- .../features/gen_ReadableStreamByobReader.rs | 4 ++-- .../gen_ReadableStreamDefaultController.rs | 11 ++++------- .../features/gen_ReadableStreamDefaultReader.rs | 4 ++-- .../gen_TransformStreamDefaultController.rs | 8 ++++---- .../web-sys/src/features/gen_WritableStream.rs | 8 ++++---- .../gen_WritableStreamDefaultController.rs | 11 ++++------- .../features/gen_WritableStreamDefaultWriter.rs | 12 ++++++------ 10 files changed, 36 insertions(+), 47 deletions(-) diff --git a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs index 723de2d17c7..c29737f5378 100644 --- a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs +++ b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs @@ -18,13 +18,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] pub fn high_water_mark(this: &ByteLengthQueuingStrategy) -> f64; - # [wasm_bindgen (structural , catch , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = size)] + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = size)] #[doc = "Getter for the `size` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/size)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] - pub fn size(this: &ByteLengthQueuingStrategy) -> Result<::js_sys::Function, JsValue>; + pub fn size(this: &ByteLengthQueuingStrategy) -> ::js_sys::Function; #[cfg(feature = "QueuingStrategyInit")] #[wasm_bindgen(catch, constructor, js_class = "ByteLengthQueuingStrategy")] #[doc = "The `new ByteLengthQueuingStrategy(..)` constructor, creating a new instance of `ByteLengthQueuingStrategy`."] diff --git a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs index 069462f76c3..779ba5b5b5d 100644 --- a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs +++ b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs @@ -18,13 +18,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] pub fn high_water_mark(this: &CountQueuingStrategy) -> f64; - # [wasm_bindgen (structural , catch , method , getter , js_class = "CountQueuingStrategy" , js_name = size)] + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = size)] #[doc = "Getter for the `size` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/size)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] - pub fn size(this: &CountQueuingStrategy) -> Result<::js_sys::Function, JsValue>; + pub fn size(this: &CountQueuingStrategy) -> ::js_sys::Function; #[cfg(feature = "QueuingStrategyInit")] #[wasm_bindgen(catch, constructor, js_class = "CountQueuingStrategy")] #[doc = "The `new CountQueuingStrategy(..)` constructor, creating a new instance of `CountQueuingStrategy`."] diff --git a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs index a82cd149bf8..df4509417a2 100644 --- a/crates/web-sys/src/features/gen_ReadableByteStreamController.rs +++ b/crates/web-sys/src/features/gen_ReadableByteStreamController.rs @@ -12,15 +12,13 @@ extern "C" { #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] pub type ReadableByteStreamController; #[cfg(feature = "ReadableStreamByobRequest")] - # [wasm_bindgen (structural , catch , method , getter , js_class = "ReadableByteStreamController" , js_name = byobRequest)] + # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = byobRequest)] #[doc = "Getter for the `byobRequest` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/byobRequest)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`, `ReadableStreamByobRequest`*"] - pub fn byob_request( - this: &ReadableByteStreamController, - ) -> Result, JsValue>; + pub fn byob_request(this: &ReadableByteStreamController) -> Option; # [wasm_bindgen (structural , method , getter , js_class = "ReadableByteStreamController" , js_name = desiredSize)] #[doc = "Getter for the `desiredSize` field of this object."] #[doc = ""] @@ -55,21 +53,18 @@ extern "C" { this: &ReadableByteStreamController, chunk: &mut [u8], ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn error(this: &ReadableByteStreamController) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "ReadableByteStreamController" , js_name = error)] + pub fn error(this: &ReadableByteStreamController); + # [wasm_bindgen (method , structural , js_class = "ReadableByteStreamController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableByteStreamController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableByteStreamController`*"] - pub fn error_with_e( - this: &ReadableByteStreamController, - e: &::wasm_bindgen::JsValue, - ) -> Result<(), JsValue>; + pub fn error_with_e(this: &ReadableByteStreamController, e: &::wasm_bindgen::JsValue); } diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs index 71bf4c35ce7..1f051255192 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs @@ -46,13 +46,13 @@ extern "C" { this: &ReadableStreamByobReader, view: &mut [u8], ) -> ::js_sys::Promise; - # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] + # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - pub fn release_lock(this: &ReadableStreamByobReader) -> Result<(), JsValue>; + pub fn release_lock(this: &ReadableStreamByobReader); # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs index 436f26a9eee..d721b20aaa7 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultController.rs @@ -42,21 +42,18 @@ extern "C" { this: &ReadableStreamDefaultController, chunk: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn error(this: &ReadableStreamDefaultController) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] + pub fn error(this: &ReadableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultController`*"] - pub fn error_with_e( - this: &ReadableStreamDefaultController, - e: &::wasm_bindgen::JsValue, - ) -> Result<(), JsValue>; + pub fn error_with_e(this: &ReadableStreamDefaultController, e: &::wasm_bindgen::JsValue); } diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs index f8f9731126f..6b12a74ca6b 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs @@ -33,13 +33,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] pub fn read(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - # [wasm_bindgen (catch , method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] + # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - pub fn release_lock(this: &ReadableStreamDefaultReader) -> Result<(), JsValue>; + pub fn release_lock(this: &ReadableStreamDefaultReader); # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs index 7c0796d4c4d..94cf3abd6c4 100644 --- a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs +++ b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs @@ -35,14 +35,14 @@ extern "C" { this: &TransformStreamDefaultController, chunk: &::wasm_bindgen::JsValue, ) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn error(this: &TransformStreamDefaultController) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] + pub fn error(this: &TransformStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/error)"] @@ -51,7 +51,7 @@ extern "C" { pub fn error_with_reason( this: &TransformStreamDefaultController, reason: &::wasm_bindgen::JsValue, - ) -> Result<(), JsValue>; + ); # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] #[doc = "The `terminate()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index 833d2ca1483..48124a3b88d 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -57,14 +57,14 @@ extern "C" { underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, ) -> Result; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = abort)] + # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - pub fn abort(this: &WritableStream) -> Result<::js_sys::Promise, JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = abort)] + pub fn abort(this: &WritableStream) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] @@ -73,7 +73,7 @@ extern "C" { pub fn abort_with_reason( this: &WritableStream, reason: &::wasm_bindgen::JsValue, - ) -> Result<::js_sys::Promise, JsValue>; + ) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs index 05a37cf10ca..424a635c96a 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs @@ -19,21 +19,18 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WritableStreamDefaultController`*"] pub fn signal(this: &WritableStreamDefaultController) -> AbortSignal; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] - pub fn error(this: &WritableStreamDefaultController) -> Result<(), JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + pub fn error(this: &WritableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] #[doc = "The `error()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] - pub fn error_with_e( - this: &WritableStreamDefaultController, - e: &::wasm_bindgen::JsValue, - ) -> Result<(), JsValue>; + pub fn error_with_e(this: &WritableStreamDefaultController, e: &::wasm_bindgen::JsValue); } diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index 95ddb072c05..2cda53f95a6 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -40,14 +40,14 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] pub fn new(stream: &WritableStream) -> Result; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - pub fn abort(this: &WritableStreamDefaultWriter) -> Result<::js_sys::Promise, JsValue>; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] + pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] @@ -56,7 +56,7 @@ extern "C" { pub fn abort_with_reason( this: &WritableStreamDefaultWriter, reason: &::wasm_bindgen::JsValue, - ) -> Result<::js_sys::Promise, JsValue>; + ) -> ::js_sys::Promise; # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] @@ -64,13 +64,13 @@ extern "C" { #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - # [wasm_bindgen (catch , method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - pub fn release_lock(this: &WritableStreamDefaultWriter) -> Result<(), JsValue>; + pub fn release_lock(this: &WritableStreamDefaultWriter); # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] From 872b0fea579f724b02b77c4e177cdd7e47bf4d72 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 5 Sep 2022 01:02:07 -0400 Subject: [PATCH 07/10] Deleted old Streams API files --- .../webidls/enabled/ReadableStream.webidl | 47 ------------------- .../unstable/ReadableStreamBYOBReader.webidl | 22 --------- .../ReadableStreamDefaultReader.webidl | 22 --------- .../ReadableStreamGenericReader.webidl | 14 ------ .../webidls/unstable/TransformStream.webidl | 16 ------- .../webidls/unstable/WritableStream.webidl | 19 -------- .../WritableStreamDefaultWriter.webidl | 22 --------- 7 files changed, 162 deletions(-) delete mode 100644 crates/web-sys/webidls/enabled/ReadableStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl delete mode 100644 crates/web-sys/webidls/unstable/TransformStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/WritableStream.webidl delete mode 100644 crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl diff --git a/crates/web-sys/webidls/enabled/ReadableStream.webidl b/crates/web-sys/webidls/enabled/ReadableStream.webidl deleted file mode 100644 index 00c8bbc8a4a..00000000000 --- a/crates/web-sys/webidls/enabled/ReadableStream.webidl +++ /dev/null @@ -1,47 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#rs-class-definition - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface ReadableStream { - constructor(optional object underlyingSource, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise cancel(optional any reason); - ReadableStreamReader getReader(optional ReadableStreamGetReaderOptions options = {}); - ReadableStream pipeThrough(ReadableWritablePair transform, optional StreamPipeOptions options = {}); - Promise pipeTo(WritableStream destination, optional StreamPipeOptions options = {}); - sequence tee(); - - async iterable(optional ReadableStreamIteratorOptions options = {}); -}; - -typedef (ReadableStreamDefaultReader or ReadableStreamBYOBReader) ReadableStreamReader; - -enum ReadableStreamReaderMode { "byob" }; - -dictionary ReadableStreamGetReaderOptions { - ReadableStreamReaderMode mode; -}; - -dictionary ReadableStreamIteratorOptions { - boolean preventCancel = false; -}; - -dictionary ReadableWritablePair { - required ReadableStream readable; - required WritableStream writable; -}; - -dictionary StreamPipeOptions { - boolean preventClose = false; - boolean preventAbort = false; - boolean preventCancel = false; - AbortSignal signal; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl deleted file mode 100644 index b8410e2e072..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamBYOBReader.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader - */ - -[Exposed=(Window,Worker,Worklet)] -interface ReadableStreamBYOBReader { - constructor(ReadableStream stream); - - Promise read(ArrayBufferView view); - undefined releaseLock(); -}; -ReadableStreamBYOBReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamBYOBReadResult { - ArrayBufferView value; - boolean done; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl deleted file mode 100644 index 076da905c12..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamDefaultReader.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamdefaultreader - */ - -[Exposed=(Window,Worker,Worklet)] -interface ReadableStreamDefaultReader { - constructor(ReadableStream stream); - - Promise read(); - undefined releaseLock(); -}; -ReadableStreamDefaultReader includes ReadableStreamGenericReader; - -dictionary ReadableStreamDefaultReadResult { - any value; - boolean done; -}; diff --git a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl b/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl deleted file mode 100644 index a6c308dad41..00000000000 --- a/crates/web-sys/webidls/unstable/ReadableStreamGenericReader.webidl +++ /dev/null @@ -1,14 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#readablestreamgenericreader - */ - -interface mixin ReadableStreamGenericReader { - readonly attribute Promise closed; - - Promise cancel(optional any reason); -}; diff --git a/crates/web-sys/webidls/unstable/TransformStream.webidl b/crates/web-sys/webidls/unstable/TransformStream.webidl deleted file mode 100644 index 61275a85237..00000000000 --- a/crates/web-sys/webidls/unstable/TransformStream.webidl +++ /dev/null @@ -1,16 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#transformstream - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface TransformStream { - constructor(optional object transformer, optional QueuingStrategy writableStrategy = {}, optional QueuingStrategy readableStrategy = {}); - - readonly attribute ReadableStream readable; - readonly attribute WritableStream writable; -}; diff --git a/crates/web-sys/webidls/unstable/WritableStream.webidl b/crates/web-sys/webidls/unstable/WritableStream.webidl deleted file mode 100644 index 0eb709ed3c8..00000000000 --- a/crates/web-sys/webidls/unstable/WritableStream.webidl +++ /dev/null @@ -1,19 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#ws-class-definition - */ - -[Exposed=(Window,Worker,Worklet), Transferable] -interface WritableStream { - constructor(optional object underlyingSink, optional QueuingStrategy strategy = {}); - - readonly attribute boolean locked; - - Promise abort(optional any reason); - Promise close(); - WritableStreamDefaultWriter getWriter(); -}; diff --git a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl b/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl deleted file mode 100644 index 9daa09a3d35..00000000000 --- a/crates/web-sys/webidls/unstable/WritableStreamDefaultWriter.webidl +++ /dev/null @@ -1,22 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - * You can obtain one at http://mozilla.org/MPL/2.0/. - * - * Source: https://streams.spec.whatwg.org/#writablestreamdefaultwriter - */ - -[Exposed=(Window,Worker,Worklet)] -interface WritableStreamDefaultWriter { - constructor(WritableStream stream); - - readonly attribute Promise closed; - readonly attribute unrestricted double? desiredSize; - readonly attribute Promise ready; - - Promise abort(optional any reason); - Promise close(); - undefined releaseLock(); - Promise write(optional any chunk); -}; From 4b48ecd559ba8a5dd60431e6b596a27d9967041d Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 5 Sep 2022 01:04:46 -0400 Subject: [PATCH 08/10] Regenerated web-sys files --- .../features/gen_ByteLengthQueuingStrategy.rs | 36 ++++++ .../src/features/gen_CountQueuingStrategy.rs | 36 ++++++ .../src/features/gen_QueuingStrategyInit.rs | 40 +++++++ .../src/features/gen_ReadableStream.rs | 8 -- .../gen_ReadableStreamByobReadResult.rs | 70 ------------ .../features/gen_ReadableStreamByobReader.rs | 32 ------ .../gen_ReadableStreamDefaultReadResult.rs | 70 ------------ .../gen_ReadableStreamDefaultReader.rs | 28 ----- .../features/gen_ReadableStreamReadResult.rs | 53 +++++++++ .../src/features/gen_ReadableStreamType.rs | 10 ++ .../src/features/gen_ReadableWritablePair.rs | 8 -- .../src/features/gen_TransformStream.rs | 12 -- .../web-sys/src/features/gen_Transformer.rs | 104 ++++++++++++++++++ .../src/features/gen_UnderlyingSink.rs | 92 ++++++++++++++++ .../src/features/gen_UnderlyingSource.rs | 98 +++++++++++++++++ .../src/features/gen_WritableStream.rs | 21 ---- .../gen_WritableStreamDefaultController.rs | 36 ++++++ .../gen_WritableStreamDefaultWriter.rs | 39 ------- crates/web-sys/src/features/mod.rs | 86 +++++++++++++-- 19 files changed, 581 insertions(+), 298 deletions(-) create mode 100644 crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs create mode 100644 crates/web-sys/src/features/gen_CountQueuingStrategy.rs create mode 100644 crates/web-sys/src/features/gen_QueuingStrategyInit.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs delete mode 100644 crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamReadResult.rs create mode 100644 crates/web-sys/src/features/gen_ReadableStreamType.rs create mode 100644 crates/web-sys/src/features/gen_Transformer.rs create mode 100644 crates/web-sys/src/features/gen_UnderlyingSink.rs create mode 100644 crates/web-sys/src/features/gen_UnderlyingSource.rs create mode 100644 crates/web-sys/src/features/gen_WritableStreamDefaultController.rs diff --git a/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs new file mode 100644 index 00000000000..c29737f5378 --- /dev/null +++ b/crates/web-sys/src/features/gen_ByteLengthQueuingStrategy.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ByteLengthQueuingStrategy , typescript_type = "ByteLengthQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ByteLengthQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub type ByteLengthQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn high_water_mark(this: &ByteLengthQueuingStrategy) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "ByteLengthQueuingStrategy" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`*"] + pub fn size(this: &ByteLengthQueuingStrategy) -> ::js_sys::Function; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "ByteLengthQueuingStrategy")] + #[doc = "The `new ByteLengthQueuingStrategy(..)` constructor, creating a new instance of `ByteLengthQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ByteLengthQueuingStrategy/ByteLengthQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ByteLengthQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_CountQueuingStrategy.rs b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs new file mode 100644 index 00000000000..779ba5b5b5d --- /dev/null +++ b/crates/web-sys/src/features/gen_CountQueuingStrategy.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = CountQueuingStrategy , typescript_type = "CountQueuingStrategy")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `CountQueuingStrategy` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub type CountQueuingStrategy; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = highWaterMark)] + #[doc = "Getter for the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/highWaterMark)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn high_water_mark(this: &CountQueuingStrategy) -> f64; + # [wasm_bindgen (structural , method , getter , js_class = "CountQueuingStrategy" , js_name = size)] + #[doc = "Getter for the `size` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/size)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`*"] + pub fn size(this: &CountQueuingStrategy) -> ::js_sys::Function; + #[cfg(feature = "QueuingStrategyInit")] + #[wasm_bindgen(catch, constructor, js_class = "CountQueuingStrategy")] + #[doc = "The `new CountQueuingStrategy(..)` constructor, creating a new instance of `CountQueuingStrategy`."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CountQueuingStrategy/CountQueuingStrategy)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `CountQueuingStrategy`, `QueuingStrategyInit`*"] + pub fn new(init: &QueuingStrategyInit) -> Result; +} diff --git a/crates/web-sys/src/features/gen_QueuingStrategyInit.rs b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs new file mode 100644 index 00000000000..89141292fbc --- /dev/null +++ b/crates/web-sys/src/features/gen_QueuingStrategyInit.rs @@ -0,0 +1,40 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = QueuingStrategyInit)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `QueuingStrategyInit` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub type QueuingStrategyInit; +} +impl QueuingStrategyInit { + #[doc = "Construct a new `QueuingStrategyInit`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn new(high_water_mark: f64) -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret.high_water_mark(high_water_mark); + ret + } + #[doc = "Change the `highWaterMark` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `QueuingStrategyInit`*"] + pub fn high_water_mark(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("highWaterMark"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStream.rs b/crates/web-sys/src/features/gen_ReadableStream.rs index a68f982b964..c66b913be9e 100644 --- a/crates/web-sys/src/features/gen_ReadableStream.rs +++ b/crates/web-sys/src/features/gen_ReadableStream.rs @@ -112,7 +112,6 @@ extern "C" { transform: &ReadableWritablePair, options: &StreamPipeOptions, ) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -120,11 +119,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))] # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)] #[doc = "The `pipeTo()` method."] @@ -132,9 +127,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn pipe_to_with_options( this: &ReadableStream, destination: &WritableStream, diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs deleted file mode 100644 index eb58aeca844..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReadResult.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamByobReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamByobReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamByobReadResult { - #[doc = "Construct a new `ReadableStreamByobReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::js_sys::Object) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -#[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamByobReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs index a630495bad7..1f051255192 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamByobReader.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamBYOBReader , typescript_type = "ReadableStreamBYOBReader")] @@ -11,22 +10,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamByobReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamBYOBReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamBYOBReader")] #[doc = "The `new ReadableStreamByobReader(..)` constructor, creating a new instance of `ReadableStreamByobReader`."] @@ -34,70 +25,47 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/ReadableStreamBYOBReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_array_buffer_view( this: &ReadableStreamByobReader, view: &::js_sys::Object, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read_with_u8_array( this: &ReadableStreamByobReader, view: &mut [u8], ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamByobReader); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamByobReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamBYOBReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamByobReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamByobReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs deleted file mode 100644 index 82bbf8ca1e1..00000000000 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReadResult.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![allow(unused_imports)] -use super::*; -use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] -#[wasm_bindgen] -extern "C" { - # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReadResult)] - #[derive(Debug, Clone, PartialEq, Eq)] - #[doc = "The `ReadableStreamDefaultReadResult` dictionary."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub type ReadableStreamDefaultReadResult; -} -#[cfg(web_sys_unstable_apis)] -impl ReadableStreamDefaultReadResult { - #[doc = "Construct a new `ReadableStreamDefaultReadResult`."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn new() -> Self { - #[allow(unused_mut)] - let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); - ret - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `done` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn done(&mut self, val: bool) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } - #[cfg(web_sys_unstable_apis)] - #[doc = "Change the `value` field of this object."] - #[doc = ""] - #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReadResult`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] - pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { - use wasm_bindgen::JsValue; - let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); - debug_assert!( - r.is_ok(), - "setting properties should never fail on our dictionary objects" - ); - let _ = r; - self - } -} -#[cfg(web_sys_unstable_apis)] -impl Default for ReadableStreamDefaultReadResult { - fn default() -> Self { - Self::new() - } -} diff --git a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs index e47c2a3073f..6b12a74ca6b 100644 --- a/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs +++ b/crates/web-sys/src/features/gen_ReadableStreamDefaultReader.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamDefaultReader , typescript_type = "ReadableStreamDefaultReader")] @@ -11,22 +10,14 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type ReadableStreamDefaultReader; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "ReadableStreamDefaultReader" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] #[wasm_bindgen(catch, constructor, js_class = "ReadableStreamDefaultReader")] #[doc = "The `new ReadableStreamDefaultReader(..)` constructor, creating a new instance of `ReadableStreamDefaultReader`."] @@ -34,53 +25,34 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/ReadableStreamDefaultReader)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &ReadableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = read)] #[doc = "The `read()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn read(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &ReadableStreamDefaultReader); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel(this: &ReadableStreamDefaultReader) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "ReadableStreamDefaultReader" , js_name = cancel)] #[doc = "The `cancel()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/cancel)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStreamDefaultReader`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn cancel_with_reason( this: &ReadableStreamDefaultReader, reason: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs new file mode 100644 index 00000000000..794dc0e9b0a --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamReadResult.rs @@ -0,0 +1,53 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStreamReadResult)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `ReadableStreamReadResult` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub type ReadableStreamReadResult; +} +impl ReadableStreamReadResult { + #[doc = "Construct a new `ReadableStreamReadResult`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `done` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn done(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("done"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `value` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamReadResult`*"] + pub fn value(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("value"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for ReadableStreamReadResult { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_ReadableStreamType.rs b/crates/web-sys/src/features/gen_ReadableStreamType.rs new file mode 100644 index 00000000000..5bbe4467f36 --- /dev/null +++ b/crates/web-sys/src/features/gen_ReadableStreamType.rs @@ -0,0 +1,10 @@ +#![allow(unused_imports)] +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +#[doc = "The `ReadableStreamType` enum."] +#[doc = ""] +#[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`*"] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum ReadableStreamType { + Bytes = "bytes", +} diff --git a/crates/web-sys/src/features/gen_ReadableWritablePair.rs b/crates/web-sys/src/features/gen_ReadableWritablePair.rs index 0ce861e74ab..8a34d98aca5 100644 --- a/crates/web-sys/src/features/gen_ReadableWritablePair.rs +++ b/crates/web-sys/src/features/gen_ReadableWritablePair.rs @@ -11,14 +11,10 @@ extern "C" { pub type ReadableWritablePair; } impl ReadableWritablePair { - #[cfg(web_sys_unstable_apis)] #[cfg(all(feature = "ReadableStream", feature = "WritableStream",))] #[doc = "Construct a new `ReadableWritablePair`."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(readable: &ReadableStream, writable: &WritableStream) -> Self { #[allow(unused_mut)] let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); @@ -44,14 +40,10 @@ impl ReadableWritablePair { let _ = r; self } - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[doc = "Change the `writable` field of this object."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableWritablePair`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(&mut self, val: &WritableStream) -> &mut Self { use wasm_bindgen::JsValue; let r = ::js_sys::Reflect::set( diff --git a/crates/web-sys/src/features/gen_TransformStream.rs b/crates/web-sys/src/features/gen_TransformStream.rs index d2a041a700c..9dd64d45d33 100644 --- a/crates/web-sys/src/features/gen_TransformStream.rs +++ b/crates/web-sys/src/features/gen_TransformStream.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = TransformStream , typescript_type = "TransformStream")] @@ -11,11 +10,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type TransformStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "ReadableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = readable)] #[doc = "Getter for the `readable` field of this object."] @@ -23,11 +18,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/readable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `TransformStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn readable(this: &TransformStream) -> ReadableStream; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] # [wasm_bindgen (structural , method , getter , js_class = "TransformStream" , js_name = writable)] #[doc = "Getter for the `writable` field of this object."] @@ -35,9 +26,6 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/writable)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStream`, `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn writable(this: &TransformStream) -> WritableStream; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "TransformStream")] diff --git a/crates/web-sys/src/features/gen_Transformer.rs b/crates/web-sys/src/features/gen_Transformer.rs new file mode 100644 index 00000000000..c0dddae0727 --- /dev/null +++ b/crates/web-sys/src/features/gen_Transformer.rs @@ -0,0 +1,104 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = Transformer)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `Transformer` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub type Transformer; +} +impl Transformer { + #[doc = "Construct a new `Transformer`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `flush` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn flush(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("flush"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `readableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn readable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("readableType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `transform` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn transform(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("transform"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `writableType` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `Transformer`*"] + pub fn writable_type(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("writableType"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for Transformer { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSink.rs b/crates/web-sys/src/features/gen_UnderlyingSink.rs new file mode 100644 index 00000000000..dd69488671c --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSink.rs @@ -0,0 +1,92 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSink)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSink` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub type UnderlyingSink; +} +impl UnderlyingSink { + #[doc = "Construct a new `UnderlyingSink`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `abort` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn abort(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("abort"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `close` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn close(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("close"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn type_(&mut self, val: &::wasm_bindgen::JsValue) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `write` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSink`*"] + pub fn write(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("write"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for UnderlyingSink { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_UnderlyingSource.rs b/crates/web-sys/src/features/gen_UnderlyingSource.rs new file mode 100644 index 00000000000..a6a90943179 --- /dev/null +++ b/crates/web-sys/src/features/gen_UnderlyingSource.rs @@ -0,0 +1,98 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UnderlyingSource)] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `UnderlyingSource` dictionary."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub type UnderlyingSource; +} +impl UnderlyingSource { + #[doc = "Construct a new `UnderlyingSource`."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn new() -> Self { + #[allow(unused_mut)] + let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); + ret + } + #[doc = "Change the `autoAllocateChunkSize` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn auto_allocate_chunk_size(&mut self, val: f64) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("autoAllocateChunkSize"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `cancel` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn cancel(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = + ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("cancel"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `pull` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn pull(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("pull"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[doc = "Change the `start` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `UnderlyingSource`*"] + pub fn start(&mut self, val: &::js_sys::Function) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("start"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } + #[cfg(feature = "ReadableStreamType")] + #[doc = "Change the `type` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `ReadableStreamType`, `UnderlyingSource`*"] + pub fn type_(&mut self, val: ReadableStreamType) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type"), &JsValue::from(val)); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } +} +impl Default for UnderlyingSource { + fn default() -> Self { + Self::new() + } +} diff --git a/crates/web-sys/src/features/gen_WritableStream.rs b/crates/web-sys/src/features/gen_WritableStream.rs index 4e1a6724780..48124a3b88d 100644 --- a/crates/web-sys/src/features/gen_WritableStream.rs +++ b/crates/web-sys/src/features/gen_WritableStream.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStream , typescript_type = "WritableStream")] @@ -11,20 +10,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStream; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , js_name = locked)] #[doc = "Getter for the `locked` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/locked)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn locked(this: &WritableStream) -> bool; #[cfg(web_sys_unstable_apis)] #[wasm_bindgen(catch, constructor, js_class = "WritableStream")] @@ -65,43 +57,30 @@ extern "C" { underlying_sink: &::js_sys::Object, strategy: &QueuingStrategy, ) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStream, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStream) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStreamDefaultWriter")] # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = getWriter)] #[doc = "The `getWriter()` method."] diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs new file mode 100644 index 00000000000..424a635c96a --- /dev/null +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultController.rs @@ -0,0 +1,36 @@ +#![allow(unused_imports)] +use super::*; +use wasm_bindgen::prelude::*; +#[wasm_bindgen] +extern "C" { + # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultController , typescript_type = "WritableStreamDefaultController")] + #[derive(Debug, Clone, PartialEq, Eq)] + #[doc = "The `WritableStreamDefaultController` class."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub type WritableStreamDefaultController; + #[cfg(feature = "AbortSignal")] + # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultController" , js_name = signal)] + #[doc = "Getter for the `signal` field of this object."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/signal)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `AbortSignal`, `WritableStreamDefaultController`*"] + pub fn signal(this: &WritableStreamDefaultController) -> AbortSignal; + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error(this: &WritableStreamDefaultController); + # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultController" , js_name = error)] + #[doc = "The `error()` method."] + #[doc = ""] + #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController/error)"] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultController`*"] + pub fn error_with_e(this: &WritableStreamDefaultController, e: &::wasm_bindgen::JsValue); +} diff --git a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs index 51721d4165c..2cda53f95a6 100644 --- a/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs +++ b/crates/web-sys/src/features/gen_WritableStreamDefaultWriter.rs @@ -1,7 +1,6 @@ #![allow(unused_imports)] use super::*; use wasm_bindgen::prelude::*; -#[cfg(web_sys_unstable_apis)] #[wasm_bindgen] extern "C" { # [wasm_bindgen (extends = :: js_sys :: Object , js_name = WritableStreamDefaultWriter , typescript_type = "WritableStreamDefaultWriter")] @@ -11,20 +10,13 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WritableStreamDefaultWriter; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = closed)] #[doc = "Getter for the `closed` field of this object."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/closed)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn closed(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; # [wasm_bindgen (structural , catch , method , getter , js_class = "WritableStreamDefaultWriter" , js_name = desiredSize)] #[doc = "Getter for the `desiredSize` field of this object."] @@ -39,11 +31,7 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/ready)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn ready(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] #[cfg(feature = "WritableStream")] #[wasm_bindgen(catch, constructor, js_class = "WritableStreamDefaultWriter")] #[doc = "The `new WritableStreamDefaultWriter(..)` constructor, creating a new instance of `WritableStreamDefaultWriter`."] @@ -51,78 +39,51 @@ extern "C" { #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/WritableStreamDefaultWriter)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn new(stream: &WritableStream) -> Result; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = abort)] #[doc = "The `abort()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/abort)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn abort_with_reason( this: &WritableStreamDefaultWriter, reason: &::wasm_bindgen::JsValue, ) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = close)] #[doc = "The `close()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/close)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn close(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = releaseLock)] #[doc = "The `releaseLock()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/releaseLock)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn release_lock(this: &WritableStreamDefaultWriter); - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write(this: &WritableStreamDefaultWriter) -> ::js_sys::Promise; - #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (method , structural , js_class = "WritableStreamDefaultWriter" , js_name = write)] #[doc = "The `write()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultWriter/write)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WritableStreamDefaultWriter`*"] - #[doc = ""] - #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] - #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub fn write_with_chunk( this: &WritableStreamDefaultWriter, chunk: &::wasm_bindgen::JsValue, diff --git a/crates/web-sys/src/features/mod.rs b/crates/web-sys/src/features/mod.rs index 59d6818792d..dfb2a94cac1 100644 --- a/crates/web-sys/src/features/mod.rs +++ b/crates/web-sys/src/features/mod.rs @@ -718,6 +718,12 @@ mod gen_BrowserFindDirection; #[cfg(feature = "BrowserFindDirection")] pub use gen_BrowserFindDirection::*; +#[cfg(feature = "ByteLengthQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_ByteLengthQueuingStrategy; +#[cfg(feature = "ByteLengthQueuingStrategy")] +pub use gen_ByteLengthQueuingStrategy::*; + #[cfg(feature = "Cache")] #[allow(non_snake_case)] mod gen_Cache; @@ -1156,6 +1162,12 @@ mod gen_Coordinates; #[cfg(feature = "Coordinates")] pub use gen_Coordinates::*; +#[cfg(feature = "CountQueuingStrategy")] +#[allow(non_snake_case)] +mod gen_CountQueuingStrategy; +#[cfg(feature = "CountQueuingStrategy")] +pub use gen_CountQueuingStrategy::*; + #[cfg(feature = "Credential")] #[allow(non_snake_case)] mod gen_Credential; @@ -5656,6 +5668,12 @@ mod gen_QueuingStrategy; #[cfg(feature = "QueuingStrategy")] pub use gen_QueuingStrategy::*; +#[cfg(feature = "QueuingStrategyInit")] +#[allow(non_snake_case)] +mod gen_QueuingStrategyInit; +#[cfg(feature = "QueuingStrategyInit")] +pub use gen_QueuingStrategyInit::*; + #[cfg(feature = "RadioNodeList")] #[allow(non_snake_case)] mod gen_RadioNodeList; @@ -5680,29 +5698,35 @@ mod gen_RcwnStatus; #[cfg(feature = "RcwnStatus")] pub use gen_RcwnStatus::*; +#[cfg(feature = "ReadableByteStreamController")] +#[allow(non_snake_case)] +mod gen_ReadableByteStreamController; +#[cfg(feature = "ReadableByteStreamController")] +pub use gen_ReadableByteStreamController::*; + #[cfg(feature = "ReadableStream")] #[allow(non_snake_case)] mod gen_ReadableStream; #[cfg(feature = "ReadableStream")] pub use gen_ReadableStream::*; -#[cfg(feature = "ReadableStreamByobReadResult")] -#[allow(non_snake_case)] -mod gen_ReadableStreamByobReadResult; -#[cfg(feature = "ReadableStreamByobReadResult")] -pub use gen_ReadableStreamByobReadResult::*; - #[cfg(feature = "ReadableStreamByobReader")] #[allow(non_snake_case)] mod gen_ReadableStreamByobReader; #[cfg(feature = "ReadableStreamByobReader")] pub use gen_ReadableStreamByobReader::*; -#[cfg(feature = "ReadableStreamDefaultReadResult")] +#[cfg(feature = "ReadableStreamByobRequest")] #[allow(non_snake_case)] -mod gen_ReadableStreamDefaultReadResult; -#[cfg(feature = "ReadableStreamDefaultReadResult")] -pub use gen_ReadableStreamDefaultReadResult::*; +mod gen_ReadableStreamByobRequest; +#[cfg(feature = "ReadableStreamByobRequest")] +pub use gen_ReadableStreamByobRequest::*; + +#[cfg(feature = "ReadableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_ReadableStreamDefaultController; +#[cfg(feature = "ReadableStreamDefaultController")] +pub use gen_ReadableStreamDefaultController::*; #[cfg(feature = "ReadableStreamDefaultReader")] #[allow(non_snake_case)] @@ -5722,12 +5746,24 @@ mod gen_ReadableStreamIteratorOptions; #[cfg(feature = "ReadableStreamIteratorOptions")] pub use gen_ReadableStreamIteratorOptions::*; +#[cfg(feature = "ReadableStreamReadResult")] +#[allow(non_snake_case)] +mod gen_ReadableStreamReadResult; +#[cfg(feature = "ReadableStreamReadResult")] +pub use gen_ReadableStreamReadResult::*; + #[cfg(feature = "ReadableStreamReaderMode")] #[allow(non_snake_case)] mod gen_ReadableStreamReaderMode; #[cfg(feature = "ReadableStreamReaderMode")] pub use gen_ReadableStreamReaderMode::*; +#[cfg(feature = "ReadableStreamType")] +#[allow(non_snake_case)] +mod gen_ReadableStreamType; +#[cfg(feature = "ReadableStreamType")] +pub use gen_ReadableStreamType::*; + #[cfg(feature = "ReadableWritablePair")] #[allow(non_snake_case)] mod gen_ReadableWritablePair; @@ -7732,6 +7768,18 @@ mod gen_TransformStream; #[cfg(feature = "TransformStream")] pub use gen_TransformStream::*; +#[cfg(feature = "TransformStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_TransformStreamDefaultController; +#[cfg(feature = "TransformStreamDefaultController")] +pub use gen_TransformStreamDefaultController::*; + +#[cfg(feature = "Transformer")] +#[allow(non_snake_case)] +mod gen_Transformer; +#[cfg(feature = "Transformer")] +pub use gen_Transformer::*; + #[cfg(feature = "TransitionEvent")] #[allow(non_snake_case)] mod gen_TransitionEvent; @@ -7810,6 +7858,18 @@ mod gen_UiEventInit; #[cfg(feature = "UiEventInit")] pub use gen_UiEventInit::*; +#[cfg(feature = "UnderlyingSink")] +#[allow(non_snake_case)] +mod gen_UnderlyingSink; +#[cfg(feature = "UnderlyingSink")] +pub use gen_UnderlyingSink::*; + +#[cfg(feature = "UnderlyingSource")] +#[allow(non_snake_case)] +mod gen_UnderlyingSource; +#[cfg(feature = "UnderlyingSource")] +pub use gen_UnderlyingSource::*; + #[cfg(feature = "Url")] #[allow(non_snake_case)] mod gen_Url; @@ -8626,6 +8686,12 @@ mod gen_WritableStream; #[cfg(feature = "WritableStream")] pub use gen_WritableStream::*; +#[cfg(feature = "WritableStreamDefaultController")] +#[allow(non_snake_case)] +mod gen_WritableStreamDefaultController; +#[cfg(feature = "WritableStreamDefaultController")] +pub use gen_WritableStreamDefaultController::*; + #[cfg(feature = "WritableStreamDefaultWriter")] #[allow(non_snake_case)] mod gen_WritableStreamDefaultWriter; From b7bf7ded266f19f8f76485c3f461cb3e26f65160 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 5 Sep 2022 13:40:19 -0400 Subject: [PATCH 09/10] Removed [Throws] from TransformStreamDefaultController.terminate --- crates/web-sys/webidls/enabled/Streams.webidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/web-sys/webidls/enabled/Streams.webidl b/crates/web-sys/webidls/enabled/Streams.webidl index c283b4e7e3f..bf57ef4ff11 100644 --- a/crates/web-sys/webidls/enabled/Streams.webidl +++ b/crates/web-sys/webidls/enabled/Streams.webidl @@ -196,7 +196,7 @@ interface TransformStreamDefaultController { [Throws] undefined enqueue(optional any chunk); undefined error(optional any reason); - [Throws] undefined terminate(); + undefined terminate(); }; dictionary QueuingStrategy { From 069196cd8b8cdb500f5e513449afb2c9ba3b0ef5 Mon Sep 17 00:00:00 2001 From: Michael Rosenberg Date: Mon, 5 Sep 2022 13:54:45 -0400 Subject: [PATCH 10/10] Regenerated web-sys files --- .../src/features/gen_TransformStreamDefaultController.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs index 94cf3abd6c4..6e4722973a5 100644 --- a/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs +++ b/crates/web-sys/src/features/gen_TransformStreamDefaultController.rs @@ -52,11 +52,11 @@ extern "C" { this: &TransformStreamDefaultController, reason: &::wasm_bindgen::JsValue, ); - # [wasm_bindgen (catch , method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] + # [wasm_bindgen (method , structural , js_class = "TransformStreamDefaultController" , js_name = terminate)] #[doc = "The `terminate()` method."] #[doc = ""] #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/TransformStreamDefaultController/terminate)"] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `TransformStreamDefaultController`*"] - pub fn terminate(this: &TransformStreamDefaultController) -> Result<(), JsValue>; + pub fn terminate(this: &TransformStreamDefaultController); }