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 = ServiceWorkerContainer , typescript_type = "ServiceWorkerContainer")] 7 #[derive(Debug, Clone, PartialEq, Eq)] 8 #[doc = "The `ServiceWorkerContainer` class."] 9 #[doc = ""] 10 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer)"] 11 #[doc = ""] 12 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] 13 pub type ServiceWorkerContainer; 14 #[cfg(feature = "ServiceWorker")] 15 # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = controller)] 16 #[doc = "Getter for the `controller` field of this object."] 17 #[doc = ""] 18 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/controller)"] 19 #[doc = ""] 20 #[doc = "*This API requires the following crate features to be activated: `ServiceWorker`, `ServiceWorkerContainer`*"] controller(this: &ServiceWorkerContainer) -> Option<ServiceWorker>21 pub fn controller(this: &ServiceWorkerContainer) -> Option<ServiceWorker>; 22 # [wasm_bindgen (structural , catch , method , getter , js_class = "ServiceWorkerContainer" , js_name = ready)] 23 #[doc = "Getter for the `ready` field of this object."] 24 #[doc = ""] 25 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/ready)"] 26 #[doc = ""] 27 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] ready(this: &ServiceWorkerContainer) -> Result<::js_sys::Promise, JsValue>28 pub fn ready(this: &ServiceWorkerContainer) -> Result<::js_sys::Promise, JsValue>; 29 # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = oncontrollerchange)] 30 #[doc = "Getter for the `oncontrollerchange` field of this object."] 31 #[doc = ""] 32 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange)"] 33 #[doc = ""] 34 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] oncontrollerchange(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>35 pub fn oncontrollerchange(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>; 36 # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerContainer" , js_name = oncontrollerchange)] 37 #[doc = "Setter for the `oncontrollerchange` field of this object."] 38 #[doc = ""] 39 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/oncontrollerchange)"] 40 #[doc = ""] 41 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] set_oncontrollerchange( this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>, )42 pub fn set_oncontrollerchange( 43 this: &ServiceWorkerContainer, 44 value: Option<&::js_sys::Function>, 45 ); 46 # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = onerror)] 47 #[doc = "Getter for the `onerror` field of this object."] 48 #[doc = ""] 49 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onerror)"] 50 #[doc = ""] 51 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] onerror(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>52 pub fn onerror(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>; 53 # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerContainer" , js_name = onerror)] 54 #[doc = "Setter for the `onerror` field of this object."] 55 #[doc = ""] 56 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onerror)"] 57 #[doc = ""] 58 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] set_onerror(this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>)59 pub fn set_onerror(this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>); 60 # [wasm_bindgen (structural , method , getter , js_class = "ServiceWorkerContainer" , js_name = onmessage)] 61 #[doc = "Getter for the `onmessage` field of this object."] 62 #[doc = ""] 63 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onmessage)"] 64 #[doc = ""] 65 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] onmessage(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>66 pub fn onmessage(this: &ServiceWorkerContainer) -> Option<::js_sys::Function>; 67 # [wasm_bindgen (structural , method , setter , js_class = "ServiceWorkerContainer" , js_name = onmessage)] 68 #[doc = "Setter for the `onmessage` field of this object."] 69 #[doc = ""] 70 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/onmessage)"] 71 #[doc = ""] 72 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] set_onmessage(this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>)73 pub fn set_onmessage(this: &ServiceWorkerContainer, value: Option<&::js_sys::Function>); 74 # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = getRegistration)] 75 #[doc = "The `getRegistration()` method."] 76 #[doc = ""] 77 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getRegistration)"] 78 #[doc = ""] 79 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] get_registration(this: &ServiceWorkerContainer) -> ::js_sys::Promise80 pub fn get_registration(this: &ServiceWorkerContainer) -> ::js_sys::Promise; 81 # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = getRegistration)] 82 #[doc = "The `getRegistration()` method."] 83 #[doc = ""] 84 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getRegistration)"] 85 #[doc = ""] 86 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] get_registration_with_document_url( this: &ServiceWorkerContainer, document_url: &str, ) -> ::js_sys::Promise87 pub fn get_registration_with_document_url( 88 this: &ServiceWorkerContainer, 89 document_url: &str, 90 ) -> ::js_sys::Promise; 91 # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = getRegistrations)] 92 #[doc = "The `getRegistrations()` method."] 93 #[doc = ""] 94 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getRegistrations)"] 95 #[doc = ""] 96 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] get_registrations(this: &ServiceWorkerContainer) -> ::js_sys::Promise97 pub fn get_registrations(this: &ServiceWorkerContainer) -> ::js_sys::Promise; 98 # [wasm_bindgen (catch , method , structural , js_class = "ServiceWorkerContainer" , js_name = getScopeForUrl)] 99 #[doc = "The `getScopeForUrl()` method."] 100 #[doc = ""] 101 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/getScopeForUrl)"] 102 #[doc = ""] 103 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] get_scope_for_url(this: &ServiceWorkerContainer, url: &str) -> Result<String, JsValue>104 pub fn get_scope_for_url(this: &ServiceWorkerContainer, url: &str) -> Result<String, JsValue>; 105 # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = register)] 106 #[doc = "The `register()` method."] 107 #[doc = ""] 108 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register)"] 109 #[doc = ""] 110 #[doc = "*This API requires the following crate features to be activated: `ServiceWorkerContainer`*"] register(this: &ServiceWorkerContainer, script_url: &str) -> ::js_sys::Promise111 pub fn register(this: &ServiceWorkerContainer, script_url: &str) -> ::js_sys::Promise; 112 #[cfg(feature = "RegistrationOptions")] 113 # [wasm_bindgen (method , structural , js_class = "ServiceWorkerContainer" , js_name = register)] 114 #[doc = "The `register()` method."] 115 #[doc = ""] 116 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register)"] 117 #[doc = ""] 118 #[doc = "*This API requires the following crate features to be activated: `RegistrationOptions`, `ServiceWorkerContainer`*"] register_with_options( this: &ServiceWorkerContainer, script_url: &str, options: &RegistrationOptions, ) -> ::js_sys::Promise119 pub fn register_with_options( 120 this: &ServiceWorkerContainer, 121 script_url: &str, 122 options: &RegistrationOptions, 123 ) -> ::js_sys::Promise; 124 } 125