File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 11open ServiceWorkerAPI
22
3+ type clientQueryOptions = {
4+ mutable includeUncontrolled ?: bool ,
5+ @as ("type" ) mutable type_ ?: string ,
6+ }
7+
8+ /**
9+ Returns a `Promise` for a `Client` matching a given id.
10+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clients/get)
11+ */
12+ @send
13+ external get : (clients , string ) => promise <Nullable .t <client >> = "get"
14+
15+ /**
16+ Returns a `Promise` for an array of `Client` objects matching the given options.
17+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clients/matchAll)
18+ */
19+ @send
20+ external matchAll : (clients , ~options : clientQueryOptions = ?) => promise <array <client >> = "matchAll"
21+
22+ /**
23+ Opens a new browser window for a given URL and returns a `Promise` for the new `WindowClient`.
24+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clients/openWindow)
25+ */
326@send
427external openWindow : (clients , string ) => promise <windowClient > = "open"
28+
29+ /**
30+ Allows an active service worker to set itself as the controller for all clients within its scope.
31+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clients/claim)
32+ */
33+ @send
34+ external claim : clients => promise <unit > = "claim"
Original file line number Diff line number Diff line change 11open ServiceWorkerAPI
22
33include WorkerGlobalScope .Impl ({type t = serviceWorkerGlobalScope })
4+
5+ /**
6+ Forces the waiting service worker to become the active service worker.
7+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope/skipWaiting)
8+ */
9+ @send
10+ external skipWaiting : serviceWorkerGlobalScope => promise <unit > = "skipWaiting"
You can’t perform that action at this time.
0 commit comments