[workbox] Fixed onSync argument type (#38695)

* [workbox] Fixed onSync argument type

* Remove unnecessary type check
This commit is contained in:
Estácio Pereira 2019-10-03 18:28:42 -03:00 committed by Ryan Cavanaugh
parent a77d55e8e5
commit c3042f83c5
2 changed files with 7 additions and 1 deletions

View File

@ -822,7 +822,7 @@ interface QueueOptions {
* Note: if the replay fails after a sync event, make sure you throw an
* error, so the browser knows to retry the sync event later.
*/
onSync: (queue: Queue) => void;
onSync: (queue: { queue: Queue }) => void;
/**
* The amount of time (in minutes) a request may be retried. After this amount of time has

View File

@ -8,3 +8,9 @@ WorkboxSW.routing.registerRoute("/", WorkboxSW.strategies.networkFirst()); // $E
WorkboxSW.precaching.precacheAndRoute(/foo/);
WorkboxSW.precaching.precacheAndRoute(["some-resource.js"], {directoryIndex: "/"}); // $ExpectType void
new WorkboxSW.backgroundSync.Queue('queue-name', {
onSync: ({ queue }) => {
queue; // $ExpectType Queue
},
});