-
Notifications
You must be signed in to change notification settings - Fork 12.8k
ServiceWorkerRegistration.Update() should return Promise<ServiceWorkerRegistration> #31502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It looks to me like this definition is what needs to be updated. TypeScript/lib/lib.webworker.d.ts Line 2721 in 00bf32c
|
After digging through how the changes would be made, I found the typescript definition matches the w3c spec. https://w3c.github.io/ServiceWorker/#serviceworkerregistration Any guidance on if I should follow-up on that spec or stick with the current definition and not use Chrome's implementation? |
On MDN they write for Chrome:
|
This seems to have changed. Running the update method in Chromium 77, I get a Edit: Tried it in Firefox 69 as well, same result as in Chromium 77. |
This function returns a Promise of a ServiceWorkerRegistration object. https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/update#return_value Fixes microsoft#31502
It looks like this need to be fixed here: https://github.com/microsoft/TypeScript-DOM-lib-generator |
Duplicate of microsoft/TypeScript-DOM-lib-generator#1684 |
TypeScript Version: 3.4.3
Search Terms:
ServiceWorkerRegistration Update
Code
Expected behavior:
result
is of typeServiceWorkerRegistration
andresult.installing
andresult.waiting
are valid.https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/update
Actual behavior:
result
is of type void and tsc gives errorserror TS2339: Property 'installing' does not exist on type 'void'.
error TS2339: Property 'waiting' does not exist on type 'void'.
Playground Link
Related Issues:
#17590
The text was updated successfully, but these errors were encountered: