Skip to content

Commit 9b66caa

Browse files
authored
Use undefined union for getRegistration()/match()/get() (#1559)
Thanks to whatwg/webidl#906.
1 parent 7777030 commit 9b66caa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/index.bs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
667667

668668
[NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options = {});
669669

670-
[NewObject] Promise<any> getRegistration(optional USVString clientURL = "");
670+
[NewObject] Promise<(ServiceWorkerRegistration or undefined)> getRegistration(optional USVString clientURL = "");
671671
[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
672672

673673
undefined startMessages();
@@ -1275,7 +1275,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
12751275
[Exposed=ServiceWorker]
12761276
interface Clients {
12771277
// The objects returned will be new instances every time
1278-
[NewObject] Promise<any> get(DOMString id);
1278+
[NewObject] Promise<(Client or undefined)> get(DOMString id);
12791279
[NewObject] Promise<FrozenArray<Client>> matchAll(optional ClientQueryOptions options = {});
12801280
[NewObject] Promise<WindowClient?> openWindow(USVString url);
12811281
[NewObject] Promise<undefined> claim();
@@ -1814,7 +1814,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
18141814
<pre class="idl">
18151815
[SecureContext, Exposed=(Window,Worker)]
18161816
interface Cache {
1817-
[NewObject] Promise&lt;any&gt; match(RequestInfo request, optional CacheQueryOptions options = {});
1817+
[NewObject] Promise&lt;(Response or undefined)&gt; match(RequestInfo request, optional CacheQueryOptions options = {});
18181818
[NewObject] Promise&lt;FrozenArray&lt;Response&gt;&gt; matchAll(optional RequestInfo request, optional CacheQueryOptions options = {});
18191819
[NewObject] Promise&lt;undefined&gt; add(RequestInfo request);
18201820
[NewObject] Promise&lt;undefined&gt; addAll(sequence&lt;RequestInfo&gt; requests);
@@ -2073,7 +2073,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
20732073
<pre class="idl">
20742074
[SecureContext, Exposed=(Window,Worker)]
20752075
interface CacheStorage {
2076-
[NewObject] Promise&lt;any&gt; match(RequestInfo request, optional MultiCacheQueryOptions options = {});
2076+
[NewObject] Promise&lt;(Response or undefined)&gt; match(RequestInfo request, optional MultiCacheQueryOptions options = {});
20772077
[NewObject] Promise&lt;boolean&gt; has(DOMString cacheName);
20782078
[NewObject] Promise&lt;Cache&gt; open(DOMString cacheName);
20792079
[NewObject] Promise&lt;boolean&gt; delete(DOMString cacheName);

0 commit comments

Comments
 (0)