1 | #![allow (unused_imports)] |
2 | #![allow (clippy::all)] |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; |
5 | #[wasm_bindgen ] |
6 | extern "C" { |
7 | # [wasm_bindgen (extends = :: js_sys :: Object , js_name = BlobPropertyBag)] |
8 | #[derive (Debug, Clone, PartialEq, Eq)] |
9 | #[doc = "The `BlobPropertyBag` dictionary." ] |
10 | #[doc = "" ] |
11 | #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*" ] |
12 | pub type BlobPropertyBag; |
13 | } |
14 | impl BlobPropertyBag { |
15 | #[doc = "Construct a new `BlobPropertyBag`." ] |
16 | #[doc = "" ] |
17 | #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*" ] |
18 | pub fn new() -> Self { |
19 | #[allow (unused_mut)] |
20 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); |
21 | ret |
22 | } |
23 | #[cfg (feature = "EndingTypes" )] |
24 | #[doc = "Change the `endings` field of this object." ] |
25 | #[doc = "" ] |
26 | #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`, `EndingTypes`*" ] |
27 | pub fn endings(&mut self, val: EndingTypes) -> &mut Self { |
28 | use wasm_bindgen::JsValue; |
29 | let r = ::js_sys::Reflect::set( |
30 | self.as_ref(), |
31 | &JsValue::from("endings" ), |
32 | &JsValue::from(val), |
33 | ); |
34 | debug_assert!( |
35 | r.is_ok(), |
36 | "setting properties should never fail on our dictionary objects" |
37 | ); |
38 | let _ = r; |
39 | self |
40 | } |
41 | #[doc = "Change the `type` field of this object." ] |
42 | #[doc = "" ] |
43 | #[doc = "*This API requires the following crate features to be activated: `BlobPropertyBag`*" ] |
44 | pub fn type_(&mut self, val: &str) -> &mut Self { |
45 | use wasm_bindgen::JsValue; |
46 | let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("type" ), &JsValue::from(val)); |
47 | debug_assert!( |
48 | r.is_ok(), |
49 | "setting properties should never fail on our dictionary objects" |
50 | ); |
51 | let _ = r; |
52 | self |
53 | } |
54 | } |
55 | impl Default for BlobPropertyBag { |
56 | fn default() -> Self { |
57 | Self::new() |
58 | } |
59 | } |
60 | |