From b26a059cae4c522efda6927d6513dd2049847c48 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 9 Feb 2026 11:19:20 -0800 Subject: [PATCH] Bring pushManager back to ServiceWorkerRegistration --- baselines/dom.generated.d.ts | 8 +++++++- baselines/sharedworker.generated.d.ts | 8 +++++++- baselines/ts5.5/dom.generated.d.ts | 8 +++++++- baselines/ts5.5/sharedworker.generated.d.ts | 8 +++++++- baselines/ts5.6/dom.generated.d.ts | 8 +++++++- baselines/ts5.6/sharedworker.generated.d.ts | 8 +++++++- baselines/ts5.9/dom.generated.d.ts | 8 +++++++- baselines/ts5.9/sharedworker.generated.d.ts | 8 +++++++- inputfiles/patches/push-api.kdl | 9 ++++----- src/build/patches.ts | 10 ++++++++-- 10 files changed, 68 insertions(+), 15 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 3a5e34d08..dea904406 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -28320,6 +28320,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -34738,7 +34744,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 8a2b414ac..df87665ed 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -7070,6 +7070,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -7803,7 +7809,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index cad1bafdf..ada17993e 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -28296,6 +28296,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -34713,7 +34719,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/ts5.5/sharedworker.generated.d.ts b/baselines/ts5.5/sharedworker.generated.d.ts index a66257021..ba3371b39 100644 --- a/baselines/ts5.5/sharedworker.generated.d.ts +++ b/baselines/ts5.5/sharedworker.generated.d.ts @@ -7067,6 +7067,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -7800,7 +7806,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/ts5.6/dom.generated.d.ts b/baselines/ts5.6/dom.generated.d.ts index dcf3e3397..3cb4db034 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -28317,6 +28317,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -34735,7 +34741,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/ts5.6/sharedworker.generated.d.ts b/baselines/ts5.6/sharedworker.generated.d.ts index a66257021..ba3371b39 100644 --- a/baselines/ts5.6/sharedworker.generated.d.ts +++ b/baselines/ts5.6/sharedworker.generated.d.ts @@ -7067,6 +7067,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -7800,7 +7806,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/ts5.9/dom.generated.d.ts b/baselines/ts5.9/dom.generated.d.ts index 62a263f45..a6895b554 100644 --- a/baselines/ts5.9/dom.generated.d.ts +++ b/baselines/ts5.9/dom.generated.d.ts @@ -28317,6 +28317,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -34735,7 +34741,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/baselines/ts5.9/sharedworker.generated.d.ts b/baselines/ts5.9/sharedworker.generated.d.ts index a38f3fb20..9fc23d1d3 100644 --- a/baselines/ts5.9/sharedworker.generated.d.ts +++ b/baselines/ts5.9/sharedworker.generated.d.ts @@ -7067,6 +7067,12 @@ declare var PushManager: { readonly supportedContentEncodings: ReadonlyArray; }; +/** Available only in secure contexts. */ +interface PushManagerAttribute { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration/pushManager) */ + readonly pushManager: PushManager; +} + /** * The **`PushSubscription`** interface of the Push API provides a subscription's URL endpoint along with the public key and secrets that should be used for encrypting push messages to this subscription. This information must be passed to the application server, using any desired application-specific method. * Available only in secure contexts. @@ -7800,7 +7806,7 @@ interface ServiceWorkerRegistrationEventMap { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerRegistration) */ -interface ServiceWorkerRegistration extends EventTarget { +interface ServiceWorkerRegistration extends EventTarget, PushManagerAttribute { /** * The **`active`** read-only property of the ServiceWorkerRegistration interface returns a service worker whose ServiceWorker.state is activating or activated. This property is initially set to null. * diff --git a/inputfiles/patches/push-api.kdl b/inputfiles/patches/push-api.kdl index 98b70f785..f78665a99 100644 --- a/inputfiles/patches/push-api.kdl +++ b/inputfiles/patches/push-api.kdl @@ -1,9 +1,8 @@ -interface-mixin PushManagerAttribute { - // Windows support only on WebKit as of 2025-10 - property pushManager exposed=ServiceWorker -} - removals { + interface Window { + // Not supported on Windows as of 2025-10 + includes PushManagerAttribute + } dictionary PushEventInit { member notification // WebKit only as of 2025-12 } diff --git a/src/build/patches.ts b/src/build/patches.ts index ac72d1742..1f57b6029 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -208,6 +208,7 @@ function handleMixinAndInterfaces( let method: Record> = {}; let constructor: DeepPartial | undefined; let typeParameters = {}; + const includes: string[] = []; for (const child of node.children) { switch (child.name) { @@ -236,6 +237,10 @@ function handleMixinAndInterfaces( typeParameters = handleTypeParameters(child); break; } + case "includes": { + includes.push(string(child.values[0])); + break; + } default: throw new Error(`Unknown node name: ${child.name}`); } @@ -255,8 +260,9 @@ function handleMixinAndInterfaces( return { name, ...optionalNestedMember("events", event, { event }), - properties: { property }, - methods: { method }, + ...optionalNestedMember("properties", property, { property }), + ...optionalNestedMember("methods", method, { method }), + ...optionalNestedMember("implements", includes, includes), ...optionalMember("extends", "string", node.properties?.extends), ...optionalMember("overrideThis", "string", node.properties?.overrideThis), ...optionalMember("forward", "string", node.properties?.forward),