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 = WritableStream , typescript_type = "WritableStream")]
8 #[derive(Debug, Clone, PartialEq, Eq)]
9 #[doc = "The `WritableStream` class."]
10 #[doc = ""]
11 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream)"]
12 #[doc = ""]
13 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
14 pub type WritableStream;
15 # [wasm_bindgen (structural , method , getter , js_class = "WritableStream" , 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/WritableStream/locked)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
21 pub fn locked(this: &WritableStream) -> bool;
22 #[wasm_bindgen(catch, constructor, js_class = "WritableStream")]
23 #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
28 pub fn new() -> Result<WritableStream, JsValue>;
29 #[wasm_bindgen(catch, constructor, js_class = "WritableStream")]
30 #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
35 pub fn new_with_underlying_sink(
36 underlying_sink: &::js_sys::Object,
37 ) -> Result<WritableStream, JsValue>;
38 #[cfg(feature = "QueuingStrategy")]
39 #[wasm_bindgen(catch, constructor, js_class = "WritableStream")]
40 #[doc = "The `new WritableStream(..)` constructor, creating a new instance of `WritableStream`."]
41 #[doc = ""]
42 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/WritableStream)"]
43 #[doc = ""]
44 #[doc = "*This API requires the following crate features to be activated: `QueuingStrategy`, `WritableStream`*"]
45 pub fn new_with_underlying_sink_and_strategy(
46 underlying_sink: &::js_sys::Object,
47 strategy: &QueuingStrategy,
48 ) -> Result<WritableStream, JsValue>;
49 # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)]
50 #[doc = "The `abort()` method."]
51 #[doc = ""]
52 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"]
53 #[doc = ""]
54 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
55 pub fn abort(this: &WritableStream) -> ::js_sys::Promise;
56 # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = abort)]
57 #[doc = "The `abort()` method."]
58 #[doc = ""]
59 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/abort)"]
60 #[doc = ""]
61 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
62 pub fn abort_with_reason(
63 this: &WritableStream,
64 reason: &::wasm_bindgen::JsValue,
65 ) -> ::js_sys::Promise;
66 # [wasm_bindgen (method , structural , js_class = "WritableStream" , js_name = close)]
67 #[doc = "The `close()` method."]
68 #[doc = ""]
69 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/close)"]
70 #[doc = ""]
71 #[doc = "*This API requires the following crate features to be activated: `WritableStream`*"]
72 pub fn close(this: &WritableStream) -> ::js_sys::Promise;
73 #[cfg(feature = "WritableStreamDefaultWriter")]
74 # [wasm_bindgen (catch , method , structural , js_class = "WritableStream" , js_name = getWriter)]
75 #[doc = "The `getWriter()` method."]
76 #[doc = ""]
77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WritableStream/getWriter)"]
78 #[doc = ""]
79 #[doc = "*This API requires the following crate features to be activated: `WritableStream`, `WritableStreamDefaultWriter`*"]
80 pub fn get_writer(this: &WritableStream) -> Result<WritableStreamDefaultWriter, JsValue>;
81}
82