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