mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[workbox] Fixed onSync argument type (#38695)
* [workbox] Fixed onSync argument type * Remove unnecessary type check
This commit is contained in:
parent
a77d55e8e5
commit
c3042f83c5
2
types/workbox-sw/index.d.ts
vendored
2
types/workbox-sw/index.d.ts
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user