Browse documentation

SwRuntime

Type. Public service worker runtime interface.

Table of contents

Category

Type

Type import

ts
import type { SwRuntime } from "valyrian.js/sw";

Public signature

ts
interface SwRuntime { state: Readonly<SwRuntimeState>; on: (event: SwRuntimeEvent, callback: (payload?: unknown) => void) => () => void; off: (event: SwRuntimeEvent, callback: (payload?: unknown) => void) => void; applyUpdate: () => void; checkForUpdate: () => Promise<void>; unregister: () => Promise<boolean>; }

Type usage

SwRuntime is the public state, subscription and update surface implemented by SwRuntimeManager.