web_sys/features/
gen_DeviceMotionEvent.rs

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