Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ServiceWorkerRegistration

This ServiceWorker API interface represents the service worker registration. You register a service worker to control one or more pages that share the same origin. Available only in secure contexts.

interface ServiceWorkerRegistration extends EventTarget {
readonly active: ServiceWorker | null;
readonly installing: ServiceWorker | null;
readonly navigationPreload: NavigationPreloadManager;
onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;
readonly pushManager: PushManager;
readonly scope: string;
readonly updateViaCache: ServiceWorkerUpdateViaCache;
readonly waiting: ServiceWorker | null;
addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(
type: K,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void;
getNotifications(filter?: GetNotificationOptions): Promise<Notification[]>;
removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(
type: K,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void;
showNotification(title: string, options?: NotificationOptions): Promise<void>;
unregister(): Promise<boolean>;
update(): Promise<void>;
}
var ServiceWorkerRegistration: {};

§Extends

§Properties

§
readonly active: ServiceWorker | null
[src]
§
readonly installing: ServiceWorker | null
[src]
§
onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null
[src]
§
readonly pushManager: PushManager
[src]
§
readonly scope: string
[src]
§
readonly updateViaCache: ServiceWorkerUpdateViaCache
[src]
§
readonly waiting: ServiceWorker | null
[src]

§Methods

§
addEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(
type: K,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
getNotifications(filter?: GetNotificationOptions): Promise<Notification[]>
[src]
§
removeEventListener<K extends keyof ServiceWorkerRegistrationEventMap>(
type: K,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
[src]
§
showNotification(title: string, options?: NotificationOptions): Promise<void>
[src]
§
unregister(): Promise<boolean>
[src]
§
update(): Promise<void>
[src]