TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
Wrong type for pushsubscriptionchange / onpushsubscriptionchange
One Line Summary
pushsubscriptionchange is currently defined as Event when it should be it's own type defined by PushSubscriptionChangeEvent in the w3c spec.
Background
PR "#944 -Remove unimplemented PushSubscriptionChangeEvent" removed PushSubscriptionChangeEvent under the wrong assumption that browsers don't support this. However it was later commented that this is supported, noted in https://github.com/mdn/browser-compat-data/issues/6715#issuecomment-886279036. Then pushsubscriptionchange was later re-added as the wrong type in (Event) https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1365
Well it's weird, because onpushsubscriptionchange exists in both Blink and Gecko while Gecko does not support PushSubscriptionChangeEvent: https://bugzilla.mozilla.org/show_bug.cgi?id=1497429, https://wpt.fyi/results/push-api/idlharness.https.any.serviceworker.html?label=experimental&label=master&aligned&view=subtest
That's why the event interface does not exist but only the event handler. ~~I'd rather remove it for now as it's essentially Blink only for now.~~ It seems the handler itself works in Gecko. 🤔
For MDN I'll file another issue. https://github.com/mdn/browser-compat-data/issues/19162