Skip to content

Commit 1ceec1a

Browse files
authored
Added support for constructor() syntax in WebIDL (#2842)
1 parent 84d726b commit 1ceec1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+755
-29
lines changed

crates/web-sys/src/features/gen_AudioData.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ extern "C" {
8383
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
8484
pub fn timestamp(this: &AudioData) -> f64;
8585
#[cfg(web_sys_unstable_apis)]
86+
#[cfg(feature = "AudioDataInit")]
87+
#[wasm_bindgen(catch, constructor, js_class = "AudioData")]
88+
#[doc = "The `new AudioData(..)` constructor, creating a new instance of `AudioData`."]
89+
#[doc = ""]
90+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioData/AudioData)"]
91+
#[doc = ""]
92+
#[doc = "*This API requires the following crate features to be activated: `AudioData`, `AudioDataInit`*"]
93+
#[doc = ""]
94+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
95+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
96+
pub fn new(init: &AudioDataInit) -> Result<AudioData, JsValue>;
97+
#[cfg(web_sys_unstable_apis)]
8698
#[cfg(feature = "AudioDataCopyToOptions")]
8799
# [wasm_bindgen (method , structural , js_class = "AudioData" , js_name = allocationSize)]
88100
#[doc = "The `allocationSize()` method."]

crates/web-sys/src/features/gen_AudioDecoder.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ extern "C" {
3939
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
4040
pub fn decode_queue_size(this: &AudioDecoder) -> u32;
4141
#[cfg(web_sys_unstable_apis)]
42+
#[cfg(feature = "AudioDecoderInit")]
43+
#[wasm_bindgen(catch, constructor, js_class = "AudioDecoder")]
44+
#[doc = "The `new AudioDecoder(..)` constructor, creating a new instance of `AudioDecoder`."]
45+
#[doc = ""]
46+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioDecoder/AudioDecoder)"]
47+
#[doc = ""]
48+
#[doc = "*This API requires the following crate features to be activated: `AudioDecoder`, `AudioDecoderInit`*"]
49+
#[doc = ""]
50+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
52+
pub fn new(init: &AudioDecoderInit) -> Result<AudioDecoder, JsValue>;
53+
#[cfg(web_sys_unstable_apis)]
4254
# [wasm_bindgen (method , structural , js_class = "AudioDecoder" , js_name = close)]
4355
#[doc = "The `close()` method."]
4456
#[doc = ""]

crates/web-sys/src/features/gen_AudioEncoder.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ extern "C" {
3939
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
4040
pub fn encode_queue_size(this: &AudioEncoder) -> u32;
4141
#[cfg(web_sys_unstable_apis)]
42+
#[cfg(feature = "AudioEncoderInit")]
43+
#[wasm_bindgen(catch, constructor, js_class = "AudioEncoder")]
44+
#[doc = "The `new AudioEncoder(..)` constructor, creating a new instance of `AudioEncoder`."]
45+
#[doc = ""]
46+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioEncoder/AudioEncoder)"]
47+
#[doc = ""]
48+
#[doc = "*This API requires the following crate features to be activated: `AudioEncoder`, `AudioEncoderInit`*"]
49+
#[doc = ""]
50+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
52+
pub fn new(init: &AudioEncoderInit) -> Result<AudioEncoder, JsValue>;
53+
#[cfg(web_sys_unstable_apis)]
4254
# [wasm_bindgen (method , structural , js_class = "AudioEncoder" , js_name = close)]
4355
#[doc = "The `close()` method."]
4456
#[doc = ""]

crates/web-sys/src/features/gen_BluetoothAdvertisingEvent.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,19 @@ extern "C" {
106106
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
107107
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
108108
pub fn service_data(this: &BluetoothAdvertisingEvent) -> BluetoothServiceDataMap;
109+
#[cfg(web_sys_unstable_apis)]
110+
#[cfg(feature = "BluetoothAdvertisingEventInit")]
111+
#[wasm_bindgen(catch, constructor, js_class = "BluetoothAdvertisingEvent")]
112+
#[doc = "The `new BluetoothAdvertisingEvent(..)` constructor, creating a new instance of `BluetoothAdvertisingEvent`."]
113+
#[doc = ""]
114+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BluetoothAdvertisingEvent/BluetoothAdvertisingEvent)"]
115+
#[doc = ""]
116+
#[doc = "*This API requires the following crate features to be activated: `BluetoothAdvertisingEvent`, `BluetoothAdvertisingEventInit`*"]
117+
#[doc = ""]
118+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
119+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
120+
pub fn new(
121+
type_: &str,
122+
init: &BluetoothAdvertisingEventInit,
123+
) -> Result<BluetoothAdvertisingEvent, JsValue>;
109124
}

crates/web-sys/src/features/gen_ClipboardEvent.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,30 @@ extern "C" {
2727
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
2828
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2929
pub fn clipboard_data(this: &ClipboardEvent) -> Option<DataTransfer>;
30+
#[cfg(web_sys_unstable_apis)]
31+
#[wasm_bindgen(catch, constructor, js_class = "ClipboardEvent")]
32+
#[doc = "The `new ClipboardEvent(..)` constructor, creating a new instance of `ClipboardEvent`."]
33+
#[doc = ""]
34+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEvent)"]
35+
#[doc = ""]
36+
#[doc = "*This API requires the following crate features to be activated: `ClipboardEvent`*"]
37+
#[doc = ""]
38+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
40+
pub fn new(type_: &str) -> Result<ClipboardEvent, JsValue>;
41+
#[cfg(web_sys_unstable_apis)]
42+
#[cfg(feature = "ClipboardEventInit")]
43+
#[wasm_bindgen(catch, constructor, js_class = "ClipboardEvent")]
44+
#[doc = "The `new ClipboardEvent(..)` constructor, creating a new instance of `ClipboardEvent`."]
45+
#[doc = ""]
46+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/ClipboardEvent)"]
47+
#[doc = ""]
48+
#[doc = "*This API requires the following crate features to be activated: `ClipboardEvent`, `ClipboardEventInit`*"]
49+
#[doc = ""]
50+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
51+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
52+
pub fn new_with_event_init_dict(
53+
type_: &str,
54+
event_init_dict: &ClipboardEventInit,
55+
) -> Result<ClipboardEvent, JsValue>;
3056
}

crates/web-sys/src/features/gen_EncodedAudioChunk.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ extern "C" {
6161
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
6262
pub fn byte_length(this: &EncodedAudioChunk) -> u32;
6363
#[cfg(web_sys_unstable_apis)]
64+
#[cfg(feature = "EncodedAudioChunkInit")]
65+
#[wasm_bindgen(catch, constructor, js_class = "EncodedAudioChunk")]
66+
#[doc = "The `new EncodedAudioChunk(..)` constructor, creating a new instance of `EncodedAudioChunk`."]
67+
#[doc = ""]
68+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedAudioChunk/EncodedAudioChunk)"]
69+
#[doc = ""]
70+
#[doc = "*This API requires the following crate features to be activated: `EncodedAudioChunk`, `EncodedAudioChunkInit`*"]
71+
#[doc = ""]
72+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
73+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
74+
pub fn new(init: &EncodedAudioChunkInit) -> Result<EncodedAudioChunk, JsValue>;
75+
#[cfg(web_sys_unstable_apis)]
6476
# [wasm_bindgen (method , structural , js_class = "EncodedAudioChunk" , js_name = copyTo)]
6577
#[doc = "The `copyTo()` method."]
6678
#[doc = ""]

crates/web-sys/src/features/gen_EncodedVideoChunk.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ extern "C" {
6161
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
6262
pub fn byte_length(this: &EncodedVideoChunk) -> u32;
6363
#[cfg(web_sys_unstable_apis)]
64+
#[cfg(feature = "EncodedVideoChunkInit")]
65+
#[wasm_bindgen(catch, constructor, js_class = "EncodedVideoChunk")]
66+
#[doc = "The `new EncodedVideoChunk(..)` constructor, creating a new instance of `EncodedVideoChunk`."]
67+
#[doc = ""]
68+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/EncodedVideoChunk/EncodedVideoChunk)"]
69+
#[doc = ""]
70+
#[doc = "*This API requires the following crate features to be activated: `EncodedVideoChunk`, `EncodedVideoChunkInit`*"]
71+
#[doc = ""]
72+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
73+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
74+
pub fn new(init: &EncodedVideoChunkInit) -> Result<EncodedVideoChunk, JsValue>;
75+
#[cfg(web_sys_unstable_apis)]
6476
# [wasm_bindgen (method , structural , js_class = "EncodedVideoChunk" , js_name = copyTo)]
6577
#[doc = "The `copyTo()` method."]
6678
#[doc = ""]

crates/web-sys/src/features/gen_GpuOutOfMemoryError.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,15 @@ extern "C" {
1515
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
1616
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
1717
pub type GpuOutOfMemoryError;
18+
#[cfg(web_sys_unstable_apis)]
19+
#[wasm_bindgen(catch, constructor, js_class = "GPUOutOfMemoryError")]
20+
#[doc = "The `new GpuOutOfMemoryError(..)` constructor, creating a new instance of `GpuOutOfMemoryError`."]
21+
#[doc = ""]
22+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUOutOfMemoryError/GPUOutOfMemoryError)"]
23+
#[doc = ""]
24+
#[doc = "*This API requires the following crate features to be activated: `GpuOutOfMemoryError`*"]
25+
#[doc = ""]
26+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
27+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
28+
pub fn new() -> Result<GpuOutOfMemoryError, JsValue>;
1829
}

crates/web-sys/src/features/gen_GpuUncapturedErrorEvent.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,19 @@ extern "C" {
2626
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
2727
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2828
pub fn error(this: &GpuUncapturedErrorEvent) -> ::js_sys::Object;
29+
#[cfg(web_sys_unstable_apis)]
30+
#[cfg(feature = "GpuUncapturedErrorEventInit")]
31+
#[wasm_bindgen(catch, constructor, js_class = "GPUUncapturedErrorEvent")]
32+
#[doc = "The `new GpuUncapturedErrorEvent(..)` constructor, creating a new instance of `GpuUncapturedErrorEvent`."]
33+
#[doc = ""]
34+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent/GPUUncapturedErrorEvent)"]
35+
#[doc = ""]
36+
#[doc = "*This API requires the following crate features to be activated: `GpuUncapturedErrorEvent`, `GpuUncapturedErrorEventInit`*"]
37+
#[doc = ""]
38+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
39+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
40+
pub fn new(
41+
type_: &str,
42+
gpu_uncaptured_error_event_init_dict: &GpuUncapturedErrorEventInit,
43+
) -> Result<GpuUncapturedErrorEvent, JsValue>;
2944
}

crates/web-sys/src/features/gen_GpuValidationError.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,15 @@ extern "C" {
2626
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
2727
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2828
pub fn message(this: &GpuValidationError) -> String;
29+
#[cfg(web_sys_unstable_apis)]
30+
#[wasm_bindgen(catch, constructor, js_class = "GPUValidationError")]
31+
#[doc = "The `new GpuValidationError(..)` constructor, creating a new instance of `GpuValidationError`."]
32+
#[doc = ""]
33+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/GPUValidationError/GPUValidationError)"]
34+
#[doc = ""]
35+
#[doc = "*This API requires the following crate features to be activated: `GpuValidationError`*"]
36+
#[doc = ""]
37+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
38+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
39+
pub fn new(message: &str) -> Result<GpuValidationError, JsValue>;
2940
}

crates/web-sys/src/features/gen_HidConnectionEvent.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,19 @@ extern "C" {
2727
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
2828
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
2929
pub fn device(this: &HidConnectionEvent) -> HidDevice;
30+
#[cfg(web_sys_unstable_apis)]
31+
#[cfg(feature = "HidConnectionEventInit")]
32+
#[wasm_bindgen(catch, constructor, js_class = "HIDConnectionEvent")]
33+
#[doc = "The `new HidConnectionEvent(..)` constructor, creating a new instance of `HidConnectionEvent`."]
34+
#[doc = ""]
35+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDConnectionEvent/HIDConnectionEvent)"]
36+
#[doc = ""]
37+
#[doc = "*This API requires the following crate features to be activated: `HidConnectionEvent`, `HidConnectionEventInit`*"]
38+
#[doc = ""]
39+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
40+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
41+
pub fn new(
42+
type_: &str,
43+
event_init_dict: &HidConnectionEventInit,
44+
) -> Result<HidConnectionEvent, JsValue>;
3045
}

crates/web-sys/src/features/gen_HidInputReportEvent.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,19 @@ extern "C" {
4949
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
5050
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
5151
pub fn data(this: &HidInputReportEvent) -> ::js_sys::DataView;
52+
#[cfg(web_sys_unstable_apis)]
53+
#[cfg(feature = "HidInputReportEventInit")]
54+
#[wasm_bindgen(catch, constructor, js_class = "HIDInputReportEvent")]
55+
#[doc = "The `new HidInputReportEvent(..)` constructor, creating a new instance of `HidInputReportEvent`."]
56+
#[doc = ""]
57+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HIDInputReportEvent/HIDInputReportEvent)"]
58+
#[doc = ""]
59+
#[doc = "*This API requires the following crate features to be activated: `HidInputReportEvent`, `HidInputReportEventInit`*"]
60+
#[doc = ""]
61+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
62+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
63+
pub fn new(
64+
type_: &str,
65+
event_init_dict: &HidInputReportEventInit,
66+
) -> Result<HidInputReportEvent, JsValue>;
5267
}

crates/web-sys/src/features/gen_ImageDecoder.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,18 @@ extern "C" {
6161
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
6262
pub fn tracks(this: &ImageDecoder) -> ImageTrackList;
6363
#[cfg(web_sys_unstable_apis)]
64+
#[cfg(feature = "ImageDecoderInit")]
65+
#[wasm_bindgen(catch, constructor, js_class = "ImageDecoder")]
66+
#[doc = "The `new ImageDecoder(..)` constructor, creating a new instance of `ImageDecoder`."]
67+
#[doc = ""]
68+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ImageDecoder/ImageDecoder)"]
69+
#[doc = ""]
70+
#[doc = "*This API requires the following crate features to be activated: `ImageDecoder`, `ImageDecoderInit`*"]
71+
#[doc = ""]
72+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
73+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
74+
pub fn new(init: &ImageDecoderInit) -> Result<ImageDecoder, JsValue>;
75+
#[cfg(web_sys_unstable_apis)]
6476
# [wasm_bindgen (method , structural , js_class = "ImageDecoder" , js_name = close)]
6577
#[doc = "The `close()` method."]
6678
#[doc = ""]

crates/web-sys/src/features/gen_ReadableStream.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,45 @@ extern "C" {
1818
#[doc = ""]
1919
#[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
2020
pub fn locked(this: &ReadableStream) -> bool;
21+
#[cfg(web_sys_unstable_apis)]
22+
#[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
23+
#[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
24+
#[doc = ""]
25+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
26+
#[doc = ""]
27+
#[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
28+
#[doc = ""]
29+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
30+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
31+
pub fn new() -> Result<ReadableStream, JsValue>;
32+
#[cfg(web_sys_unstable_apis)]
33+
#[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
34+
#[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
35+
#[doc = ""]
36+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
37+
#[doc = ""]
38+
#[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
39+
#[doc = ""]
40+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42+
pub fn new_with_underlying_source(
43+
underlying_source: &::js_sys::Object,
44+
) -> Result<ReadableStream, JsValue>;
45+
#[cfg(web_sys_unstable_apis)]
46+
#[cfg(feature = "QueuingStrategy")]
47+
#[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
48+
#[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
49+
#[doc = ""]
50+
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
51+
#[doc = ""]
52+
#[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `ReadableStream`*"]
53+
#[doc = ""]
54+
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
55+
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
56+
pub fn new_with_underlying_source_and_strategy(
57+
underlying_source: &::js_sys::Object,
58+
strategy: &QueuingStrategy,
59+
) -> Result<ReadableStream, JsValue>;
2160
# [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = cancel)]
2261
#[doc = "The `cancel()` method."]
2362
#[doc = ""]

0 commit comments

Comments
 (0)