maxcountryman_web_sys/features/
gen_DeviceMotionEvent.rs

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