Skip to content

Commit

Permalink
Update interfaces/service-workers.idl (#15894)
Browse files Browse the repository at this point in the history
  • Loading branch information
autofoolip authored and foolip committed Mar 17, 2019
1 parent 82e94b3 commit 8142b08
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions interfaces/service-workers.idl
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: Service Workers 1 (https://w3c.github.io/ServiceWorker/v1/)
// Source: Service Workers Nightly (https://w3c.github.io/ServiceWorker/)

[SecureContext, Exposed=(Window,Worker)]
interface ServiceWorker : EventTarget {
readonly attribute USVString scriptURL;
readonly attribute ServiceWorkerState state;
void postMessage(any message, optional sequence<object> transfer = []);
void postMessage(any message, sequence<object> transfer);
void postMessage(any message, optional PostMessageOptions options);

// event
attribute EventHandler onstatechange;
Expand All @@ -27,6 +28,7 @@ interface ServiceWorkerRegistration : EventTarget {
readonly attribute ServiceWorker? installing;
readonly attribute ServiceWorker? waiting;
readonly attribute ServiceWorker? active;
[SameObject] readonly attribute NavigationPreloadManager navigationPreload;

readonly attribute USVString scope;
readonly attribute ServiceWorkerUpdateViaCache updateViaCache;
Expand Down Expand Up @@ -76,6 +78,19 @@ dictionary RegistrationOptions {
ServiceWorkerUpdateViaCache updateViaCache = "imports";
};

[SecureContext, Exposed=(Window,Worker)]
interface NavigationPreloadManager {
Promise<void> enable();
Promise<void> disable();
Promise<void> setHeaderValue(ByteString value);
Promise<NavigationPreloadState> getState();
};

dictionary NavigationPreloadState {
boolean enabled = false;
ByteString headerValue;
};

[Global=(Worker,ServiceWorker), Exposed=ServiceWorker]
interface ServiceWorkerGlobalScope : WorkerGlobalScope {
[SameObject] readonly attribute Clients clients;
Expand All @@ -98,7 +113,8 @@ interface Client {
readonly attribute FrameType frameType;
readonly attribute DOMString id;
readonly attribute ClientType type;
void postMessage(any message, optional sequence<object> transfer = []);
void postMessage(any message, sequence<object> transfer);
void postMessage(any message, optional PostMessageOptions options);
};

[Exposed=ServiceWorker]
Expand Down Expand Up @@ -150,14 +166,20 @@ dictionary ExtendableEventInit : EventInit {
[Constructor(DOMString type, FetchEventInit eventInitDict), Exposed=ServiceWorker]
interface FetchEvent : ExtendableEvent {
[SameObject] readonly attribute Request request;
readonly attribute Promise<any> preloadResponse;
readonly attribute DOMString clientId;
readonly attribute DOMString resultingClientId;
readonly attribute DOMString replacesClientId;

void respondWith(Promise<Response> r);
};

dictionary FetchEventInit : ExtendableEventInit {
required Request request;
Promise<any> preloadResponse;
DOMString clientId = "";
DOMString resultingClientId = "";
DOMString replacesClientId = "";
};

[Constructor(DOMString type, optional ExtendableMessageEventInit eventInitDict), Exposed=ServiceWorker]
Expand All @@ -177,7 +199,7 @@ dictionary ExtendableMessageEventInit : ExtendableEventInit {
sequence<MessagePort> ports = [];
};

partial interface WindowOrWorkerGlobalScope {
partial interface mixin WindowOrWorkerGlobalScope {
[SecureContext, SameObject] readonly attribute CacheStorage caches;
};

Expand Down

0 comments on commit 8142b08

Please sign in to comment.