Skip to main content

web_sys/features/
gen_BatteryManager.rs

1#![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 = "BatteryManager",
11        typescript_type = "BatteryManager"
12    )]
13    #[derive(Debug, Clone, PartialEq, Eq)]
14    #[doc = "The `BatteryManager` class."]
15    #[doc = ""]
16    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager)"]
17    #[doc = ""]
18    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
19    pub type BatteryManager;
20    #[wasm_bindgen(method, getter, js_class = "BatteryManager", js_name = "charging")]
21    #[doc = "Getter for the `charging` field of this object."]
22    #[doc = ""]
23    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/charging)"]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
26    pub fn charging(this: &BatteryManager) -> bool;
27    #[wasm_bindgen(method, getter, js_class = "BatteryManager", js_name = "chargingTime")]
28    #[doc = "Getter for the `chargingTime` field of this object."]
29    #[doc = ""]
30    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/chargingTime)"]
31    #[doc = ""]
32    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
33    pub fn charging_time(this: &BatteryManager) -> f64;
34    #[wasm_bindgen(
35        method,
36        getter,
37        js_class = "BatteryManager",
38        js_name = "dischargingTime"
39    )]
40    #[doc = "Getter for the `dischargingTime` field of this object."]
41    #[doc = ""]
42    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/dischargingTime)"]
43    #[doc = ""]
44    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
45    pub fn discharging_time(this: &BatteryManager) -> f64;
46    #[wasm_bindgen(method, getter, js_class = "BatteryManager", js_name = "level")]
47    #[doc = "Getter for the `level` field of this object."]
48    #[doc = ""]
49    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/level)"]
50    #[doc = ""]
51    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
52    pub fn level(this: &BatteryManager) -> f64;
53    #[wasm_bindgen(
54        method,
55        getter,
56        js_class = "BatteryManager",
57        js_name = "onchargingchange"
58    )]
59    #[doc = "Getter for the `onchargingchange` field of this object."]
60    #[doc = ""]
61    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingchange)"]
62    #[doc = ""]
63    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
64    pub fn onchargingchange(this: &BatteryManager) -> Option<::js_sys::Function>;
65    #[wasm_bindgen(
66        method,
67        setter,
68        js_class = "BatteryManager",
69        js_name = "onchargingchange"
70    )]
71    #[doc = "Setter for the `onchargingchange` field of this object."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingchange)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
76    pub fn set_onchargingchange(this: &BatteryManager, value: Option<&::js_sys::Function>);
77    #[wasm_bindgen(
78        method,
79        getter,
80        js_class = "BatteryManager",
81        js_name = "onchargingtimechange"
82    )]
83    #[doc = "Getter for the `onchargingtimechange` field of this object."]
84    #[doc = ""]
85    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingtimechange)"]
86    #[doc = ""]
87    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
88    pub fn onchargingtimechange(this: &BatteryManager) -> Option<::js_sys::Function>;
89    #[wasm_bindgen(
90        method,
91        setter,
92        js_class = "BatteryManager",
93        js_name = "onchargingtimechange"
94    )]
95    #[doc = "Setter for the `onchargingtimechange` field of this object."]
96    #[doc = ""]
97    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onchargingtimechange)"]
98    #[doc = ""]
99    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
100    pub fn set_onchargingtimechange(this: &BatteryManager, value: Option<&::js_sys::Function>);
101    #[wasm_bindgen(
102        method,
103        getter,
104        js_class = "BatteryManager",
105        js_name = "ondischargingtimechange"
106    )]
107    #[doc = "Getter for the `ondischargingtimechange` field of this object."]
108    #[doc = ""]
109    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/ondischargingtimechange)"]
110    #[doc = ""]
111    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
112    pub fn ondischargingtimechange(this: &BatteryManager) -> Option<::js_sys::Function>;
113    #[wasm_bindgen(
114        method,
115        setter,
116        js_class = "BatteryManager",
117        js_name = "ondischargingtimechange"
118    )]
119    #[doc = "Setter for the `ondischargingtimechange` field of this object."]
120    #[doc = ""]
121    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/ondischargingtimechange)"]
122    #[doc = ""]
123    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
124    pub fn set_ondischargingtimechange(this: &BatteryManager, value: Option<&::js_sys::Function>);
125    #[wasm_bindgen(method, getter, js_class = "BatteryManager", js_name = "onlevelchange")]
126    #[doc = "Getter for the `onlevelchange` field of this object."]
127    #[doc = ""]
128    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onlevelchange)"]
129    #[doc = ""]
130    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
131    pub fn onlevelchange(this: &BatteryManager) -> Option<::js_sys::Function>;
132    #[wasm_bindgen(method, setter, js_class = "BatteryManager", js_name = "onlevelchange")]
133    #[doc = "Setter for the `onlevelchange` field of this object."]
134    #[doc = ""]
135    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager/onlevelchange)"]
136    #[doc = ""]
137    #[doc = "*This API requires the following crate features to be activated: `BatteryManager`*"]
138    pub fn set_onlevelchange(this: &BatteryManager, value: Option<&::js_sys::Function>);
139}