Skip to main content

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