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