maxcountryman_web_sys/features/
gen_ScreenOrientation.rs1#![allow(unused_imports)]
2use super::*;
3use wasm_bindgen::prelude::*;
4#[wasm_bindgen]
5extern "C" {
6 # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = ScreenOrientation , typescript_type = "ScreenOrientation")]
7 #[derive(Debug, Clone, PartialEq, Eq)]
8 #[doc = "The `ScreenOrientation` class."]
9 #[doc = ""]
10 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation)"]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
13 pub type ScreenOrientation;
14 #[cfg(feature = "OrientationType")]
15 # [wasm_bindgen (structural , catch , method , getter , js_class = "ScreenOrientation" , js_name = type)]
16 #[doc = "Getter for the `type` field of this object."]
17 #[doc = ""]
18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/type)"]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `OrientationType`, `ScreenOrientation`*"]
21 pub fn type_(this: &ScreenOrientation) -> Result<OrientationType, JsValue>;
22 # [wasm_bindgen (structural , catch , method , getter , js_class = "ScreenOrientation" , js_name = angle)]
23 #[doc = "Getter for the `angle` field of this object."]
24 #[doc = ""]
25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/angle)"]
26 #[doc = ""]
27 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
28 pub fn angle(this: &ScreenOrientation) -> Result<u16, JsValue>;
29 # [wasm_bindgen (structural , method , getter , js_class = "ScreenOrientation" , js_name = onchange)]
30 #[doc = "Getter for the `onchange` field of this object."]
31 #[doc = ""]
32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/onchange)"]
33 #[doc = ""]
34 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
35 pub fn onchange(this: &ScreenOrientation) -> Option<::js_sys::Function>;
36 # [wasm_bindgen (structural , method , setter , js_class = "ScreenOrientation" , js_name = onchange)]
37 #[doc = "Setter for the `onchange` field of this object."]
38 #[doc = ""]
39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/onchange)"]
40 #[doc = ""]
41 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
42 pub fn set_onchange(this: &ScreenOrientation, value: Option<&::js_sys::Function>);
43 #[cfg(feature = "OrientationLockType")]
44 # [wasm_bindgen (catch , method , structural , js_class = "ScreenOrientation" , js_name = lock)]
45 #[doc = "The `lock()` method."]
46 #[doc = ""]
47 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock)"]
48 #[doc = ""]
49 #[doc = "*This API requires the following crate features to be activated: `OrientationLockType`, `ScreenOrientation`*"]
50 pub fn lock(
51 this: &ScreenOrientation,
52 orientation: OrientationLockType,
53 ) -> Result<::js_sys::Promise, JsValue>;
54 # [wasm_bindgen (catch , method , structural , js_class = "ScreenOrientation" , js_name = unlock)]
55 #[doc = "The `unlock()` method."]
56 #[doc = ""]
57 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock)"]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
60 pub fn unlock(this: &ScreenOrientation) -> Result<(), JsValue>;
61}