electron_sys/module/
native_theme.rs

1use js_sys::JsString;
2use node_sys::EventEmitter;
3use wasm_bindgen::prelude::*;
4
5#[wasm_bindgen(module = "electron")]
6extern {
7    #[wasm_bindgen(extends = EventEmitter)]
8    pub type NativeTheme;
9
10    #[wasm_bindgen(js_name = "nativeTheme")]
11    pub static native_theme: NativeTheme;
12
13    // FIXME: event overloads
14
15    //*********************//
16    // Instance Properties //
17    //*********************//
18
19    #[wasm_bindgen(method, getter, js_name = "shouldUseDarkColors")]
20    pub fn should_use_dark_colors(this: &NativeTheme) -> bool; // readonly
21
22    #[wasm_bindgen(method, getter, js_name = "shouldUseHighContrastColors")]
23    pub fn should_use_high_contrast_colors(this: &NativeTheme) -> bool; // readonly
24
25    #[wasm_bindgen(method, getter, js_name = "shouldUseInvertedColorScheme")]
26    pub fn should_use_inverted_color_scheme(this: &NativeTheme) -> bool; // readonly
27
28    #[wasm_bindgen(method, getter, js_name = "themeSource")]
29    pub fn theme_source(this: &NativeTheme) -> JsString;
30
31    #[wasm_bindgen(method, setter, js_name = "themeSource")]
32    pub fn set_theme_source(this: &NativeTheme, value: JsString);
33}