electron_sys/class/
notification.rs1use crate::interface::NotificationOptions;
2use js_sys::JsString;
3use node_sys::events::EventEmitter;
4use wasm_bindgen::prelude::*;
5
6#[wasm_bindgen(module = "electron")]
7extern {
8 #[wasm_bindgen(extends = EventEmitter)]
9 #[derive(Clone, Debug)]
10 pub type Notification;
12
13 #[wasm_bindgen(constructor)]
18 pub fn new(options: Option<NotificationOptions>) -> Notification;
19
20 #[wasm_bindgen(static_method_of = Notification, js_name = "isSupported")]
25 pub fn is_supported() -> bool;
26
27 #[wasm_bindgen(method)]
32 pub fn close(this: &Notification);
33
34 #[wasm_bindgen(method)]
35 pub fn show(this: &Notification);
36
37 #[wasm_bindgen(method, getter)]
42 pub fn actions(this: &Notification) -> Box<[JsValue]>;
43
44 #[wasm_bindgen(method, setter)]
45 pub fn set_actions(this: &Notification, value: Box<[JsValue]>);
46
47 #[wasm_bindgen(method, getter)]
48 pub fn body(this: &Notification) -> JsString;
49
50 #[wasm_bindgen(method, setter)]
51 pub fn set_body(this: &Notification, value: JsString);
52
53 #[wasm_bindgen(method, getter, js_name = "closeButtonText")]
54 pub fn close_button_text(this: &Notification) -> JsString;
55
56 #[wasm_bindgen(method, setter, js_name = "closeButtonText")]
57 pub fn set_close_button_text(this: &Notification, value: JsString);
58
59 #[wasm_bindgen(method, getter, js_name = "hasReply")]
60 pub fn has_reply(this: &Notification) -> JsString;
61
62 #[wasm_bindgen(method, setter, js_name = "hasReply")]
63 pub fn set_has_reply(this: &Notification, value: JsString);
64
65 #[wasm_bindgen(method, getter, js_name = "replyPlaceholder")]
66 pub fn reply_placeholder(this: &Notification) -> JsString;
67
68 #[wasm_bindgen(method, setter, js_name = "replyPlaceholder")]
69 pub fn set_reply_placeholder(this: &Notification, value: JsString);
70
71 #[wasm_bindgen(method, getter)]
72 pub fn silent(this: &Notification) -> bool;
73
74 #[wasm_bindgen(method, setter)]
75 pub fn set_silent(this: &Notification, value: bool);
76
77 #[wasm_bindgen(method, getter)]
78 pub fn sound(this: &Notification) -> JsString;
79
80 #[wasm_bindgen(method, setter)]
81 pub fn set_sound(this: &Notification, value: JsString);
82
83 #[wasm_bindgen(method, getter)]
84 pub fn subtitle(this: &Notification) -> JsString;
85
86 #[wasm_bindgen(method, setter)]
87 pub fn set_subtitle(this: &Notification, value: JsString);
88
89 #[wasm_bindgen(method, getter)]
90 pub fn timeout_type(this: &Notification) -> JsString;
91
92 #[wasm_bindgen(method, setter)]
93 pub fn set_timeout_type(this: &Notification, value: JsString);
94
95 #[wasm_bindgen(method, getter)]
96 pub fn title(this: &Notification) -> JsString;
97
98 #[wasm_bindgen(method, setter)]
99 pub fn set_title(this: &Notification, value: JsString);
100
101 #[wasm_bindgen(method, getter)]
102 pub fn urgency(this: &Notification) -> JsString;
103
104 #[wasm_bindgen(method, setter)]
105 pub fn set_urgency(this: &Notification, value: JsString);
106}