Package-level declarations

Types

Link copied to clipboard
sealed external class Client

The Client interface represents an executable context such as a Worker, or a SharedWorker. Window clients are represented by the more-specific WindowClient. You can get Client/WindowClient objects from methods such as Clients.matchAll() and Clients.get().

Link copied to clipboard
external interface ClientQueryOptions
Link copied to clipboard
sealed external class Clients

Provides access to Client objects. Access it via self.clients within a service worker.

Link copied to clipboard
sealed external interface ClientTypes
Link copied to clipboard
open external class ExtendableEvent(val type: EventType<ExtendableEvent>, init: ExtendableEventInit = definedExternally) : Event

Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries.

Link copied to clipboard
external interface ExtendableEventInit : EventInit
Link copied to clipboard
Link copied to clipboard
sealed external class ExtendableEventTypes_deprecated
Link copied to clipboard
open external class ExtendableMessageEvent(val type: EventType<ExtendableMessageEvent>, init: ExtendableMessageEventInit = definedExternally) : ExtendableEvent

This ServiceWorker API interface represents the event object of a message event fired on a service worker (when a channel message is received on the ServiceWorkerGlobalScope from another context) — extends the lifetime of such events.

Link copied to clipboard
Link copied to clipboard
open external class FetchEvent(val type: EventType<FetchEvent>, init: FetchEventInit) : ExtendableEvent

This is the event type for fetch events dispatched on the service worker global scope. It contains information about the fetch, including the request and how the receiver will treat the response. It provides the event.respondWith() method, which allows us to provide a response to this fetch.

Link copied to clipboard
external interface FetchEventInit : ExtendableEventInit
Link copied to clipboard
Link copied to clipboard
sealed external class FetchEventTypes_deprecated
Link copied to clipboard
sealed external interface FrameType
Link copied to clipboard
external interface GetNotificationOptions
Link copied to clipboard
sealed external class NavigationPreloadManager

Available only in secure contexts.

Link copied to clipboard
external interface NavigationPreloadState
Link copied to clipboard

The parameter passed into the onnotificationclick handler, the NotificationEvent interface represents a notification click event that is dispatched on the ServiceWorkerGlobalScope of a ServiceWorker.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
sealed external class NotificationEventTypes_deprecated
Link copied to clipboard
external interface RegistrationOptions
Link copied to clipboard

This ServiceWorker API interface provides a reference to a service worker. Multiple browsing contexts (e.g. pages, workers, etc.) can be associated with the same service worker, each through a unique ServiceWorker object. Available only in secure contexts.

Link copied to clipboard
sealed external class ServiceWorkerContainer : EventTarget

The ServiceWorkerContainer interface of the ServiceWorker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations. Available only in secure contexts.

Link copied to clipboard

This ServiceWorker API interface represents the global execution context of a service worker. Available only in secure contexts.

Link copied to clipboard
sealed external class ServiceWorkerRegistration : EventTarget

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.

Link copied to clipboard
sealed external interface ServiceWorkerState
Link copied to clipboard
sealed external interface ServiceWorkerUpdateViaCache
Link copied to clipboard
sealed external class WindowClient : Client

This ServiceWorker API interface represents the scope of a service worker client that is a document in a browser context, controlled by an active worker. The service worker client independently selects and uses a service worker for its own loading and sub-resources.

Properties

Link copied to clipboard