-
Notifications
You must be signed in to change notification settings - Fork 816
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
Workbox event types #2156
Workbox event types #2156
Conversation
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Wow, I did not know about this. I applied it to props as well. #2157. Makes it a little verbose, but up to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just when I thought I understood TypeScript... thanks for working this out.
975ca75
to
71bbe6a
Compare
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
PR-Bot Size PluginChanged File Sizes
New FilesNo new files have been added. All File SizesView Table
Workbox Aggregate Size Plugin3.5KB gzip'ed (23% of limit) |
R: @jeffposnick
This PR adds some additional type information to address #2144. Primarily, it adds additional event callback types as well as a
WorkboxEventMap
interface so callbacks can declare their event callback argument types based on the event type passed toaddEventListener()
.This means developer code doesn't have to import the
WorkboxEvent
type and annotate their own callbacks -- the types are inferred from the event type listened to. (Note: I took this pattern from the built-inaddEventListener()
declaration, so I assume it's how these types of APIs are supposed to be typed.)/cc @azizhk