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