microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
601 stars 418 forks source link

`ServiceWorkerRegistration.update()` should return `Promise<ServiceWorkerRegistration>` #1684

Open jespertheend opened 5 months ago

jespertheend commented 5 months ago

Currently it is defined in lib.dom.ts to return Promise<void>.

See the MDN page for update() which mentions:

Return value A Promise that resolves with a ServiceWorkerRegistration object.

The spec is a bit unclear because it mentions some job logic:

  1. Let job be the result of running Create Job with update

but in the end it seems like this promise is always resolved with a ServiceWorkerRegistration.