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); +};