web_sys/features/
gen_MediaQueryList.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7 #[wasm_bindgen(
8 extends = "EventTarget",
9 extends = "::js_sys::Object",
10 js_name = "MediaQueryList",
11 typescript_type = "MediaQueryList"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `MediaQueryList` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
19 pub type MediaQueryList;
20 #[wasm_bindgen(method, getter, js_class = "MediaQueryList", js_name = "media")]
21 #[doc = "Getter for the `media` field of this object."]
22 #[doc = ""]
23 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/media)"]
24 #[doc = ""]
25 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
26 pub fn media(this: &MediaQueryList) -> ::alloc::string::String;
27 #[wasm_bindgen(method, getter, js_class = "MediaQueryList", js_name = "matches")]
28 #[doc = "Getter for the `matches` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/matches)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
33 pub fn matches(this: &MediaQueryList) -> bool;
34 #[wasm_bindgen(method, getter, js_class = "MediaQueryList", js_name = "onchange")]
35 #[doc = "Getter for the `onchange` field of this object."]
36 #[doc = ""]
37 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/onchange)"]
38 #[doc = ""]
39 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
40 pub fn onchange(this: &MediaQueryList) -> Option<::js_sys::Function>;
41 #[wasm_bindgen(method, setter, js_class = "MediaQueryList", js_name = "onchange")]
42 #[doc = "Setter for the `onchange` field of this object."]
43 #[doc = ""]
44 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/onchange)"]
45 #[doc = ""]
46 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
47 pub fn set_onchange(this: &MediaQueryList, value: Option<&::js_sys::Function>);
48 #[wasm_bindgen(catch, method, js_class = "MediaQueryList", js_name = "addListener")]
49 #[doc = "The `addListener()` method."]
50 #[doc = ""]
51 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener)"]
52 #[doc = ""]
53 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
54 pub fn add_listener_with_opt_callback(
55 this: &MediaQueryList,
56 listener: Option<&::js_sys::Function>,
57 ) -> Result<(), JsValue>;
58 #[cfg(feature = "EventListener")]
59 #[wasm_bindgen(catch, method, js_class = "MediaQueryList", js_name = "addListener")]
60 #[doc = "The `addListener()` method."]
61 #[doc = ""]
62 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener)"]
63 #[doc = ""]
64 #[doc = "*This API requires the following crate features to be activated: `EventListener`, `MediaQueryList`*"]
65 pub fn add_listener_with_opt_event_listener(
66 this: &MediaQueryList,
67 listener: Option<&EventListener>,
68 ) -> Result<(), JsValue>;
69 #[wasm_bindgen(catch, method, js_class = "MediaQueryList", js_name = "removeListener")]
70 #[doc = "The `removeListener()` method."]
71 #[doc = ""]
72 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/removeListener)"]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `MediaQueryList`*"]
75 pub fn remove_listener_with_opt_callback(
76 this: &MediaQueryList,
77 listener: Option<&::js_sys::Function>,
78 ) -> Result<(), JsValue>;
79 #[cfg(feature = "EventListener")]
80 #[wasm_bindgen(catch, method, js_class = "MediaQueryList", js_name = "removeListener")]
81 #[doc = "The `removeListener()` method."]
82 #[doc = ""]
83 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/removeListener)"]
84 #[doc = ""]
85 #[doc = "*This API requires the following crate features to be activated: `EventListener`, `MediaQueryList`*"]
86 pub fn remove_listener_with_opt_event_listener(
87 this: &MediaQueryList,
88 listener: Option<&EventListener>,
89 ) -> Result<(), JsValue>;
90}