web_sys/features/
gen_ScreenOrientation.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 = "ScreenOrientation",
11 typescript_type = "ScreenOrientation"
12 )]
13 #[derive(Debug, Clone, PartialEq, Eq)]
14 #[doc = "The `ScreenOrientation` class."]
15 #[doc = ""]
16 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation)"]
17 #[doc = ""]
18 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
19 pub type ScreenOrientation;
20 #[cfg(feature = "OrientationType")]
21 #[wasm_bindgen(
22 catch,
23 method,
24 getter,
25 js_class = "ScreenOrientation",
26 js_name = "type"
27 )]
28 #[doc = "Getter for the `type` field of this object."]
29 #[doc = ""]
30 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/type)"]
31 #[doc = ""]
32 #[doc = "*This API requires the following crate features to be activated: `OrientationType`, `ScreenOrientation`*"]
33 pub fn type_(this: &ScreenOrientation) -> Result<OrientationType, JsValue>;
34 #[wasm_bindgen(
35 catch,
36 method,
37 getter,
38 js_class = "ScreenOrientation",
39 js_name = "angle"
40 )]
41 #[doc = "Getter for the `angle` field of this object."]
42 #[doc = ""]
43 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/angle)"]
44 #[doc = ""]
45 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
46 pub fn angle(this: &ScreenOrientation) -> Result<u16, JsValue>;
47 #[wasm_bindgen(method, getter, js_class = "ScreenOrientation", js_name = "onchange")]
48 #[doc = "Getter for the `onchange` field of this object."]
49 #[doc = ""]
50 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/onchange)"]
51 #[doc = ""]
52 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
53 pub fn onchange(this: &ScreenOrientation) -> Option<::js_sys::Function>;
54 #[wasm_bindgen(method, setter, js_class = "ScreenOrientation", js_name = "onchange")]
55 #[doc = "Setter for the `onchange` field of this object."]
56 #[doc = ""]
57 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/onchange)"]
58 #[doc = ""]
59 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
60 pub fn set_onchange(this: &ScreenOrientation, value: Option<&::js_sys::Function>);
61 #[cfg(feature = "OrientationLockType")]
62 #[wasm_bindgen(catch, method, js_class = "ScreenOrientation")]
63 #[doc = "The `lock()` method."]
64 #[doc = ""]
65 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock)"]
66 #[doc = ""]
67 #[doc = "*This API requires the following crate features to be activated: `OrientationLockType`, `ScreenOrientation`*"]
68 pub fn lock(
69 this: &ScreenOrientation,
70 orientation: OrientationLockType,
71 ) -> Result<::js_sys::Promise, JsValue>;
72 #[wasm_bindgen(catch, method, js_class = "ScreenOrientation")]
73 #[doc = "The `unlock()` method."]
74 #[doc = ""]
75 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock)"]
76 #[doc = ""]
77 #[doc = "*This API requires the following crate features to be activated: `ScreenOrientation`*"]
78 pub fn unlock(this: &ScreenOrientation) -> Result<(), JsValue>;
79}