1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ReadableStream , typescript_type = "ReadableStream")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `ReadableStream` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
14 pub type ReadableStream;
15 # [wasm_bindgen (structural , method , getter , js_class = "ReadableStream" , js_name = locked)]
16 #[doc = "Getter for the `locked` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/locked)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
21 pub fn locked(this: &ReadableStream) -> bool;
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 pub fn new() -> Result<ReadableStream, JsValue>;
29 #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
30 #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
35 pub fn new_with_underlying_source(
36 underlying_source: &::js_sys::Object,
37 ) -> Result<ReadableStream, JsValue>;
38 #[cfg(feature = "QueuingStrategy")]
39 #[wasm_bindgen(catch, constructor, js_class = "ReadableStream")]
40 #[doc = "The `new ReadableStream(..)` constructor, creating a new instance of `ReadableStream`."]
41 #[doc = ""]
42 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/ReadableStream)"]
43 #[doc = ""]
44 #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `ReadableStream`*"]
45 pub fn new_with_underlying_source_and_strategy(
46 underlying_source: &::js_sys::Object,
47 strategy: &QueuingStrategy,
48 ) -> Result<ReadableStream, JsValue>;
49 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = cancel)]
50 #[doc = "The `cancel()` method."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
55 pub fn cancel(this: &ReadableStream) -> ::js_sys::Promise;
56 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = cancel)]
57 #[doc = "The `cancel()` method."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/cancel)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
62 pub fn cancel_with_reason(
63 this: &ReadableStream,
64 reason: &::wasm_bindgen::JsValue,
65 ) -> ::js_sys::Promise;
66 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = getReader)]
67 #[doc = "The `getReader()` method."]
68 #[doc = ""]
69 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader)"]
70 #[doc = ""]
71 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
72 pub fn get_reader(this: &ReadableStream) -> ::js_sys::Object;
73 #[cfg(feature = "ReadableStreamGetReaderOptions")]
74 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = getReader)]
75 #[doc = "The `getReader()` method."]
76 #[doc = ""]
77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/getReader)"]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableStreamGetReaderOptions`*"]
80 pub fn get_reader_with_options(
81 this: &ReadableStream,
82 options: &ReadableStreamGetReaderOptions,
83 ) -> ::js_sys::Object;
84 #[cfg(feature = "ReadableWritablePair")]
85 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeThrough)]
86 #[doc = "The `pipeThrough()` method."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeThrough)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`*"]
91 pub fn pipe_through(this: &ReadableStream, transform: &ReadableWritablePair) -> ReadableStream;
92 #[cfg(all(feature = "ReadableWritablePair", feature = "StreamPipeOptions",))]
93 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeThrough)]
94 #[doc = "The `pipeThrough()` method."]
95 #[doc = ""]
96 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeThrough)"]
97 #[doc = ""]
98 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `ReadableWritablePair`, `StreamPipeOptions`*"]
99 pub fn pipe_through_with_options(
100 this: &ReadableStream,
101 transform: &ReadableWritablePair,
102 options: &StreamPipeOptions,
103 ) -> ReadableStream;
104 #[cfg(feature = "WritableStream")]
105 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)]
106 #[doc = "The `pipeTo()` method."]
107 #[doc = ""]
108 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"]
109 #[doc = ""]
110 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `WritableStream`*"]
111 pub fn pipe_to(this: &ReadableStream, destination: &WritableStream) -> ::js_sys::Promise;
112 #[cfg(all(feature = "StreamPipeOptions", feature = "WritableStream",))]
113 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = pipeTo)]
114 #[doc = "The `pipeTo()` method."]
115 #[doc = ""]
116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/pipeTo)"]
117 #[doc = ""]
118 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`, `StreamPipeOptions`, `WritableStream`*"]
119 pub fn pipe_to_with_options(
120 this: &ReadableStream,
121 destination: &WritableStream,
122 options: &StreamPipeOptions,
123 ) -> ::js_sys::Promise;
124 # [wasm_bindgen (method , structural , js_class = "ReadableStream" , js_name = tee)]
125 #[doc = "The `tee()` method."]
126 #[doc = ""]
127 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee)"]
128 #[doc = ""]
129 #[doc = "*This API requires the following crate features to be activated: `ReadableStream`*"]
130 pub fn tee(this: &ReadableStream) -> ::js_sys::Array;
131}
132