chromium/third_party/blink/renderer/modules/service_worker/service_worker_registration.idl

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// https://w3c.github.io/ServiceWorker/#enumdef-serviceworkerupdateviacache
enum ServiceWorkerUpdateViaCache {
    "imports",
    "all",
    "none"
};

// https://w3c.github.io/ServiceWorker/#serviceworkerregistration-interface
[
    ActiveScriptWrappable,
    SecureContext,
    Exposed=(Window,Worker)
] interface ServiceWorkerRegistration : EventTarget {
    readonly attribute ServiceWorker? installing;
    readonly attribute ServiceWorker? waiting;
    readonly attribute ServiceWorker? active;
    readonly attribute NavigationPreloadManager navigationPreload;

    readonly attribute USVString scope;
    readonly attribute ServiceWorkerUpdateViaCache updateViaCache;

    [CallWith=ScriptState, RaisesException] Promise<ServiceWorkerRegistration> update();
    [CallWith=ScriptState, RaisesException] Promise<boolean> unregister();

    attribute EventHandler onupdatefound;
};