Skip to content

Commit ef421a1

Browse files
Togeticclaude
andauthored
fix(registry): don't declare the global Window via extends (#878)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 8d08f47 commit ef421a1

22 files changed

Lines changed: 296 additions & 20 deletions

‎packages/script/src/runtime/registry/ahrefs-analytics.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export interface AhrefsAnalyticsApi {
2929
}
3030

3131
declare global {
32-
interfaceWindowextendsAhrefsAnalyticsApi{}
32+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
33+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
34+
interfaceWindow{
35+
AhrefsAnalytics: AhrefsAnalyticsApi['AhrefsAnalytics']
36+
}
3337
}
3438

3539
/**

‎packages/script/src/runtime/registry/calendly.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export interface CalendlyApi {
7676
}
7777

7878
declare global {
79-
interfaceWindowextendsCalendlyApi{}
79+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
80+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
81+
interfaceWindow{
82+
Calendly: CalendlyApi['Calendly']
83+
}
8084
}
8185

8286
constCALENDLY_CSS_KEY='nuxt-scripts-calendly-css'

‎packages/script/src/runtime/registry/clarity.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export interface ClarityApi {
2525
}
2626

2727
declare global {
28-
interfaceWindowextendsClarityApi{}
28+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
29+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
30+
interfaceWindow{
31+
clarity: ClarityApi['clarity']
32+
}
2933
}
3034

3135
exporttypeClarityInput=RegistryScriptInput<typeofClarityOptions>

‎packages/script/src/runtime/registry/cloudflare-web-analytics.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export interface CloudflareWebAnalyticsApi {
2020
}
2121

2222
declare global {
23-
interfaceWindowextendsCloudflareWebAnalyticsApi{}
23+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
24+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
25+
interfaceWindow{
26+
__cfBeacon: CloudflareWebAnalyticsApi['__cfBeacon']
27+
}
2428
}
2529

2630
exporttypeCloudflareWebAnalyticsInput=RegistryScriptInput<typeofCloudflareWebAnalyticsOptions>

‎packages/script/src/runtime/registry/google-adsense.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ export interface GoogleAdsenseApi {
1515
}
1616

1717
declare global {
18-
interfaceWindowextendsGoogleAdsenseApi{}
18+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
19+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
20+
interfaceWindow{
21+
adsbygoogle: GoogleAdsenseApi['adsbygoogle']
22+
}
1923
}
2024

2125
/**

‎packages/script/src/runtime/registry/google-recaptcha.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export interface GoogleRecaptchaApi {
1919
}
2020

2121
declare global {
22-
interfaceWindowextendsGoogleRecaptchaApi{}
22+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
23+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
24+
interfaceWindow{
25+
grecaptcha: GoogleRecaptchaApi['grecaptcha']
26+
}
2327
}
2428

2529
exportfunctionuseScriptGoogleRecaptcha<TextendsGoogleRecaptchaApi>(_options?: GoogleRecaptchaInput){

‎packages/script/src/runtime/registry/google-tag-manager.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export interface GoogleTagManagerApi {
8282
* instead, which is also the only access path that respects a custom dataLayer name.
8383
*/
8484
declare global {
85-
interfaceWindowextendsPick<GoogleTagManagerApi,'google_tag_manager'>{}
85+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
86+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
87+
interfaceWindow{
88+
google_tag_manager: GoogleTagManagerApi['google_tag_manager']
89+
}
8690
}
8791

8892
export{GoogleTagManagerOptions}

‎packages/script/src/runtime/registry/hotjar.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export interface HotjarApi {
1111
}
1212

1313
declare global {
14-
interfaceWindowextendsHotjarApi{
14+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
15+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
16+
interfaceWindow{
17+
hj: HotjarApi['hj']
1518
_hjSettings: {hjid: number,hjsv?: number}
1619
}
1720
}

‎packages/script/src/runtime/registry/intercom.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ export interface IntercomApi {
3434
}
3535

3636
declare global {
37-
interfaceWindowextendsIntercomApi{
37+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
38+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
39+
interfaceWindow{
40+
Intercom: IntercomApi['Intercom']
3841
intercomSettings?: any
3942
}
4043
}

‎packages/script/src/runtime/registry/leaflet.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export interface LeafletApi {
1313
}
1414

1515
declare global {
16-
interfaceWindowextendsLeafletApi{}
16+
// Declared inline rather than via `extends`: an `extends` clause on the global `Window`
17+
// surfaces as an unsuppressable TS2430 in consumer code when another package declares it (#852).
18+
interfaceWindow{
19+
L: LeafletApi['L']
20+
}
1721
}
1822

1923
exportfunctionuseScriptLeaflet<TextendsLeafletApi>(_options?: LeafletInput){

0 commit comments

Comments
 (0)