![JAR search and dependency download from the Maven repository](/logo.png)
elemental2.dom.ServiceWorkerContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elemental2-dom Show documentation
Show all versions of elemental2-dom Show documentation
Thin Java abstractions for the native Browser APIs.
The newest version!
/*
* Copyright 2018 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package elemental2.dom;
import elemental2.core.JsArray;
import elemental2.promise.Promise;
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import jsinterop.base.Js;
@JsType(isNative = true, namespace = JsPackage.GLOBAL)
public interface ServiceWorkerContainer extends EventTarget {
@JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL)
public interface GetRegistrationDocumentURLUnionType {
@JsOverlay
static ServiceWorkerContainer.GetRegistrationDocumentURLUnionType of(Object o) {
return Js.cast(o);
}
@JsOverlay
default String asString() {
return Js.asString(this);
}
@JsOverlay
default URL asURL() {
return Js.cast(this);
}
@JsOverlay
default boolean isString() {
return (Object) this instanceof String;
}
@JsOverlay
default boolean isURL() {
return (Object) this instanceof URL;
}
}
@JsFunction
public interface OncontrollerchangeFn {
void onInvoke(Event p0);
}
@JsFunction
public interface OnerrorFn {
void onInvoke(ErrorEvent p0);
}
@JsFunction
public interface OnmessageFn {
void onInvoke(ExtendableMessageEvent p0);
}
@JsType(isNative = true, name = "?", namespace = JsPackage.GLOBAL)
public interface RegisterScriptURLUnionType {
@JsOverlay
static ServiceWorkerContainer.RegisterScriptURLUnionType of(Object o) {
return Js.cast(o);
}
@JsOverlay
default String asString() {
return Js.asString(this);
}
@JsOverlay
default TrustedScriptURL asTrustedScriptURL() {
return Js.cast(this);
}
@JsOverlay
default URL asURL() {
return Js.cast(this);
}
@JsOverlay
default boolean isString() {
return (Object) this instanceof String;
}
@JsOverlay
default boolean isTrustedScriptURL() {
return (Object) this instanceof TrustedScriptURL;
}
@JsOverlay
default boolean isURL() {
return (Object) this instanceof URL;
}
}
@JsProperty
ServiceWorker getController();
@JsProperty
ServiceWorkerContainer.OncontrollerchangeFn getOncontrollerchange();
@JsProperty
ServiceWorkerContainer.OnerrorFn getOnerror();
@JsProperty
ServiceWorkerContainer.OnmessageFn getOnmessage();
@JsProperty
Promise getReady();
Promise getRegistration();
Promise getRegistration(
ServiceWorkerContainer.GetRegistrationDocumentURLUnionType documentURL);
@JsOverlay
default Promise getRegistration(String documentURL) {
return getRegistration(
Js.uncheckedCast(documentURL));
}
@JsOverlay
default Promise getRegistration(URL documentURL) {
return getRegistration(
Js.uncheckedCast(documentURL));
}
Promise> getRegistrations();
Promise register(
ServiceWorkerContainer.RegisterScriptURLUnionType scriptURL, RegistrationOptions options);
Promise register(
ServiceWorkerContainer.RegisterScriptURLUnionType scriptURL);
@JsOverlay
default Promise register(
String scriptURL, RegistrationOptions options) {
return register(
Js.uncheckedCast(scriptURL), options);
}
@JsOverlay
default Promise register(String scriptURL) {
return register(Js.uncheckedCast(scriptURL));
}
@JsOverlay
default Promise register(
TrustedScriptURL scriptURL, RegistrationOptions options) {
return register(
Js.uncheckedCast(scriptURL), options);
}
@JsOverlay
default Promise register(TrustedScriptURL scriptURL) {
return register(Js.uncheckedCast(scriptURL));
}
@JsOverlay
default Promise register(URL scriptURL, RegistrationOptions options) {
return register(
Js.uncheckedCast(scriptURL), options);
}
@JsOverlay
default Promise register(URL scriptURL) {
return register(Js.uncheckedCast(scriptURL));
}
@JsProperty
void setController(ServiceWorker controller);
@JsProperty
void setOncontrollerchange(ServiceWorkerContainer.OncontrollerchangeFn oncontrollerchange);
@JsProperty
void setOnerror(ServiceWorkerContainer.OnerrorFn onerror);
@JsProperty
void setOnmessage(ServiceWorkerContainer.OnmessageFn onmessage);
@JsProperty
void setReady(Promise ready);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy