web_sys/features/
gen_FetchEvent.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = ExtendableEvent , extends = Event , extends = :: js_sys :: Object , js_name = FetchEvent , typescript_type = "FetchEvent")]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `FetchEvent` class."]
10    #[doc = ""]
11    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent)"]
12    #[doc = ""]
13    #[doc = "*This API requires the following crate features to be activated: `FetchEvent`*"]
14    pub type FetchEvent;
15    #[cfg(feature = "Request")]
16    # [wasm_bindgen (structural , method , getter , js_class = "FetchEvent" , js_name = request)]
17    #[doc = "Getter for the `request` field of this object."]
18    #[doc = ""]
19    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/request)"]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `FetchEvent`, `Request`*"]
22    pub fn request(this: &FetchEvent) -> Request;
23    # [wasm_bindgen (structural , method , getter , js_class = "FetchEvent" , js_name = clientId)]
24    #[doc = "Getter for the `clientId` field of this object."]
25    #[doc = ""]
26    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/clientId)"]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `FetchEvent`*"]
29    pub fn client_id(this: &FetchEvent) -> Option<::alloc::string::String>;
30    # [wasm_bindgen (structural , method , getter , js_class = "FetchEvent" , js_name = isReload)]
31    #[doc = "Getter for the `isReload` field of this object."]
32    #[doc = ""]
33    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/isReload)"]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `FetchEvent`*"]
36    pub fn is_reload(this: &FetchEvent) -> bool;
37    #[cfg(feature = "FetchEventInit")]
38    #[wasm_bindgen(catch, constructor, js_class = "FetchEvent")]
39    #[doc = "The `new FetchEvent(..)` constructor, creating a new instance of `FetchEvent`."]
40    #[doc = ""]
41    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/FetchEvent)"]
42    #[doc = ""]
43    #[doc = "*This API requires the following crate features to be activated: `FetchEvent`, `FetchEventInit`*"]
44    pub fn new(type_: &str, event_init_dict: &FetchEventInit) -> Result<FetchEvent, JsValue>;
45    # [wasm_bindgen (catch , method , structural , js_class = "FetchEvent" , js_name = respondWith)]
46    #[doc = "The `respondWith()` method."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `FetchEvent`*"]
51    pub fn respond_with(this: &FetchEvent, r: &::js_sys::Promise) -> Result<(), JsValue>;
52}