1 #![allow(unused_imports)]
2 use super::*;
3 use wasm_bindgen::prelude::*;
4 #[wasm_bindgen]
5 extern "C" {
6     # [wasm_bindgen (extends = EventTarget , extends = :: js_sys :: Object , js_name = Notification , typescript_type = "Notification")]
7     #[derive(Debug, Clone, PartialEq, Eq)]
8     #[doc = "The `Notification` class."]
9     #[doc = ""]
10     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification)"]
11     #[doc = ""]
12     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
13     pub type Notification;
14     #[cfg(feature = "NotificationPermission")]
15     # [wasm_bindgen (structural , static_method_of = Notification , getter , js_class = "Notification" , js_name = permission)]
16     #[doc = "Getter for the `permission` field of this object."]
17     #[doc = ""]
18     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/permission)"]
19     #[doc = ""]
20     #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationPermission`*"]
permission() -> NotificationPermission21     pub fn permission() -> NotificationPermission;
22     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onclick)]
23     #[doc = "Getter for the `onclick` field of this object."]
24     #[doc = ""]
25     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclick)"]
26     #[doc = ""]
27     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
onclick(this: &Notification) -> Option<::js_sys::Function>28     pub fn onclick(this: &Notification) -> Option<::js_sys::Function>;
29     # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onclick)]
30     #[doc = "Setter for the `onclick` field of this object."]
31     #[doc = ""]
32     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclick)"]
33     #[doc = ""]
34     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
set_onclick(this: &Notification, value: Option<&::js_sys::Function>)35     pub fn set_onclick(this: &Notification, value: Option<&::js_sys::Function>);
36     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onshow)]
37     #[doc = "Getter for the `onshow` field of this object."]
38     #[doc = ""]
39     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onshow)"]
40     #[doc = ""]
41     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
onshow(this: &Notification) -> Option<::js_sys::Function>42     pub fn onshow(this: &Notification) -> Option<::js_sys::Function>;
43     # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onshow)]
44     #[doc = "Setter for the `onshow` field of this object."]
45     #[doc = ""]
46     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onshow)"]
47     #[doc = ""]
48     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
set_onshow(this: &Notification, value: Option<&::js_sys::Function>)49     pub fn set_onshow(this: &Notification, value: Option<&::js_sys::Function>);
50     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onerror)]
51     #[doc = "Getter for the `onerror` field of this object."]
52     #[doc = ""]
53     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onerror)"]
54     #[doc = ""]
55     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
onerror(this: &Notification) -> Option<::js_sys::Function>56     pub fn onerror(this: &Notification) -> Option<::js_sys::Function>;
57     # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onerror)]
58     #[doc = "Setter for the `onerror` field of this object."]
59     #[doc = ""]
60     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onerror)"]
61     #[doc = ""]
62     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
set_onerror(this: &Notification, value: Option<&::js_sys::Function>)63     pub fn set_onerror(this: &Notification, value: Option<&::js_sys::Function>);
64     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = onclose)]
65     #[doc = "Getter for the `onclose` field of this object."]
66     #[doc = ""]
67     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclose)"]
68     #[doc = ""]
69     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
onclose(this: &Notification) -> Option<::js_sys::Function>70     pub fn onclose(this: &Notification) -> Option<::js_sys::Function>;
71     # [wasm_bindgen (structural , method , setter , js_class = "Notification" , js_name = onclose)]
72     #[doc = "Setter for the `onclose` field of this object."]
73     #[doc = ""]
74     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/onclose)"]
75     #[doc = ""]
76     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
set_onclose(this: &Notification, value: Option<&::js_sys::Function>)77     pub fn set_onclose(this: &Notification, value: Option<&::js_sys::Function>);
78     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = title)]
79     #[doc = "Getter for the `title` field of this object."]
80     #[doc = ""]
81     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/title)"]
82     #[doc = ""]
83     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
title(this: &Notification) -> String84     pub fn title(this: &Notification) -> String;
85     #[cfg(feature = "NotificationDirection")]
86     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = dir)]
87     #[doc = "Getter for the `dir` field of this object."]
88     #[doc = ""]
89     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/dir)"]
90     #[doc = ""]
91     #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationDirection`*"]
dir(this: &Notification) -> NotificationDirection92     pub fn dir(this: &Notification) -> NotificationDirection;
93     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = lang)]
94     #[doc = "Getter for the `lang` field of this object."]
95     #[doc = ""]
96     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/lang)"]
97     #[doc = ""]
98     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
lang(this: &Notification) -> Option<String>99     pub fn lang(this: &Notification) -> Option<String>;
100     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = body)]
101     #[doc = "Getter for the `body` field of this object."]
102     #[doc = ""]
103     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/body)"]
104     #[doc = ""]
105     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
body(this: &Notification) -> Option<String>106     pub fn body(this: &Notification) -> Option<String>;
107     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = tag)]
108     #[doc = "Getter for the `tag` field of this object."]
109     #[doc = ""]
110     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/tag)"]
111     #[doc = ""]
112     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
tag(this: &Notification) -> Option<String>113     pub fn tag(this: &Notification) -> Option<String>;
114     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = icon)]
115     #[doc = "Getter for the `icon` field of this object."]
116     #[doc = ""]
117     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/icon)"]
118     #[doc = ""]
119     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
icon(this: &Notification) -> Option<String>120     pub fn icon(this: &Notification) -> Option<String>;
121     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = requireInteraction)]
122     #[doc = "Getter for the `requireInteraction` field of this object."]
123     #[doc = ""]
124     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requireInteraction)"]
125     #[doc = ""]
126     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
require_interaction(this: &Notification) -> bool127     pub fn require_interaction(this: &Notification) -> bool;
128     # [wasm_bindgen (structural , method , getter , js_class = "Notification" , js_name = data)]
129     #[doc = "Getter for the `data` field of this object."]
130     #[doc = ""]
131     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/data)"]
132     #[doc = ""]
133     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
data(this: &Notification) -> ::wasm_bindgen::JsValue134     pub fn data(this: &Notification) -> ::wasm_bindgen::JsValue;
135     #[wasm_bindgen(catch, constructor, js_class = "Notification")]
136     #[doc = "The `new Notification(..)` constructor, creating a new instance of `Notification`."]
137     #[doc = ""]
138     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification)"]
139     #[doc = ""]
140     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
new(title: &str) -> Result<Notification, JsValue>141     pub fn new(title: &str) -> Result<Notification, JsValue>;
142     #[cfg(feature = "NotificationOptions")]
143     #[wasm_bindgen(catch, constructor, js_class = "Notification")]
144     #[doc = "The `new Notification(..)` constructor, creating a new instance of `Notification`."]
145     #[doc = ""]
146     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification)"]
147     #[doc = ""]
148     #[doc = "*This API requires the following crate features to be activated: `Notification`, `NotificationOptions`*"]
new_with_options( title: &str, options: &NotificationOptions, ) -> Result<Notification, JsValue>149     pub fn new_with_options(
150         title: &str,
151         options: &NotificationOptions,
152     ) -> Result<Notification, JsValue>;
153     # [wasm_bindgen (method , structural , js_class = "Notification" , js_name = close)]
154     #[doc = "The `close()` method."]
155     #[doc = ""]
156     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/close)"]
157     #[doc = ""]
158     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
close(this: &Notification)159     pub fn close(this: &Notification);
160     # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = get)]
161     #[doc = "The `get()` method."]
162     #[doc = ""]
163     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/get)"]
164     #[doc = ""]
165     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
get() -> Result<::js_sys::Promise, JsValue>166     pub fn get() -> Result<::js_sys::Promise, JsValue>;
167     #[cfg(feature = "GetNotificationOptions")]
168     # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = get)]
169     #[doc = "The `get()` method."]
170     #[doc = ""]
171     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/get)"]
172     #[doc = ""]
173     #[doc = "*This API requires the following crate features to be activated: `GetNotificationOptions`, `Notification`*"]
get_with_filter(filter: &GetNotificationOptions) -> Result<::js_sys::Promise, JsValue>174     pub fn get_with_filter(filter: &GetNotificationOptions) -> Result<::js_sys::Promise, JsValue>;
175     # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = requestPermission)]
176     #[doc = "The `requestPermission()` method."]
177     #[doc = ""]
178     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission)"]
179     #[doc = ""]
180     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
request_permission() -> Result<::js_sys::Promise, JsValue>181     pub fn request_permission() -> Result<::js_sys::Promise, JsValue>;
182     # [wasm_bindgen (catch , static_method_of = Notification , js_class = "Notification" , js_name = requestPermission)]
183     #[doc = "The `requestPermission()` method."]
184     #[doc = ""]
185     #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Notification/requestPermission)"]
186     #[doc = ""]
187     #[doc = "*This API requires the following crate features to be activated: `Notification`*"]
request_permission_with_permission_callback( permission_callback: &::js_sys::Function, ) -> Result<::js_sys::Promise, JsValue>188     pub fn request_permission_with_permission_callback(
189         permission_callback: &::js_sys::Function,
190     ) -> Result<::js_sys::Promise, JsValue>;
191 }
192