electron_sys/module/
power_save_blocker.rs

1use js_sys::JsString;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen(module = "electron")]
5extern {
6    #[wasm_bindgen]
7    pub type PowerSaveBlocker;
8
9    #[wasm_bindgen(js_name = "powerSaveBlocker")]
10    pub static power_save_blocker: PowerSaveBlocker;
11
12    #[wasm_bindgen(method, js_name = "isStarted")]
13    pub fn is_started(this: &PowerSaveBlocker, id: u32) -> bool;
14
15    #[wasm_bindgen(method)]
16    pub fn start(this: &PowerSaveBlocker, kind: &JsString) -> u32;
17
18    #[wasm_bindgen(method)]
19    pub fn stop(this: &PowerSaveBlocker, id: u32);
20}