Skip to content

Commit 7412e2a

Browse files
committed
Create a Globalized Type
1 parent a244dbd commit 7412e2a

20 files changed

Lines changed: 102 additions & 62 deletions

baselines/dom.generated.d.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12234,7 +12234,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
1223412234
*
1223512235
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/defaultView)
1223612236
*/
12237-
readonly defaultView: (WindowProxy & typeof globalThis) | null;
12237+
readonly defaultView: Globalized<WindowProxy> | null;
1223812238
/**
1223912239
* **`document.designMode`** controls whether the entire document is editable. Valid values are "on" and "off". According to the specification, this property is meant to default to "off". Firefox follows this standard. The earlier versions of Chrome and IE default to "inherit". Starting in Chrome 43, the default is "off" and "inherit" is no longer supported. In IE6-10, the value is capitalized.
1224012240
*
@@ -39699,7 +39699,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3969939699
*
3970039700
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/self)
3970139701
*/
39702-
readonly self: Window & typeof globalThis;
39702+
readonly self: Globalized;
3970339703
/**
3970439704
* The **`speechSynthesis`** read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
3970539705
*
@@ -39742,7 +39742,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3974239742
*
3974339743
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/window)
3974439744
*/
39745-
readonly window: Window & typeof globalThis;
39745+
readonly window: Globalized;
3974639746
/**
3974739747
* **`window.alert()`** instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
3974839748
*
@@ -41881,7 +41881,7 @@ declare var scrollbars: BarProp;
4188141881
*
4188241882
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/self)
4188341883
*/
41884-
declare var self: Window & typeof globalThis;
41884+
declare var self: Globalized;
4188541885
/**
4188641886
* The **`speechSynthesis`** read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
4188741887
*
@@ -41924,7 +41924,7 @@ declare var visualViewport: VisualViewport | null;
4192441924
*
4192541925
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/window)
4192641926
*/
41927-
declare var window: Window & typeof globalThis;
41927+
declare var window: Globalized;
4192841928
/**
4192941929
* **`window.alert()`** instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
4193041930
*
@@ -42450,6 +42450,7 @@ type GLsizei = number;
4245042450
type GLsizeiptr = number;
4245142451
type GLuint = number;
4245242452
type GLuint64 = number;
42453+
type Globalized<T = Window> = T & typeof globalThis;
4245342454
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
4245442455
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
4245542456
type HashAlgorithmIdentifier = AlgorithmIdentifier;

baselines/serviceworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10867,7 +10867,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1086710867
*
1086810868
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1086910869
*/
10870-
readonly self: WorkerGlobalScope & typeof globalThis;
10870+
readonly self: Globalized<WorkerGlobalScope>;
1087110871
/**
1087210872
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1087310873
*
@@ -11666,7 +11666,7 @@ declare var onunhandledrejection: ((this: ServiceWorkerGlobalScope, ev: PromiseR
1166611666
*
1166711667
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1166811668
*/
11669-
declare var self: WorkerGlobalScope & typeof globalThis;
11669+
declare var self: Globalized<WorkerGlobalScope>;
1167011670
/**
1167111671
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1167211672
*
@@ -11758,6 +11758,7 @@ type GLsizei = number;
1175811758
type GLsizeiptr = number;
1175911759
type GLuint = number;
1176011760
type GLuint64 = number;
11761+
type Globalized<T = Window> = T & typeof globalThis;
1176111762
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1176211763
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1176311764
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

baselines/sharedworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10400,7 +10400,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1040010400
*
1040110401
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1040210402
*/
10403-
readonly self: WorkerGlobalScope & typeof globalThis;
10403+
readonly self: Globalized<WorkerGlobalScope>;
1040410404
/**
1040510405
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1040610406
*
@@ -11350,7 +11350,7 @@ declare var onunhandledrejection: ((this: SharedWorkerGlobalScope, ev: PromiseRe
1135011350
*
1135111351
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1135211352
*/
11353-
declare var self: WorkerGlobalScope & typeof globalThis;
11353+
declare var self: Globalized<WorkerGlobalScope>;
1135411354
/**
1135511355
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1135611356
*
@@ -11441,6 +11441,7 @@ type GLsizei = number;
1144111441
type GLsizeiptr = number;
1144211442
type GLuint = number;
1144311443
type GLuint64 = number;
11444+
type Globalized<T = Window> = T & typeof globalThis;
1144411445
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1144511446
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1144611447
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

baselines/ts5.5/dom.generated.d.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12223,7 +12223,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
1222312223
*
1222412224
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/defaultView)
1222512225
*/
12226-
readonly defaultView: (WindowProxy & typeof globalThis) | null;
12226+
readonly defaultView: Globalized<WindowProxy> | null;
1222712227
/**
1222812228
* **`document.designMode`** controls whether the entire document is editable. Valid values are "on" and "off". According to the specification, this property is meant to default to "off". Firefox follows this standard. The earlier versions of Chrome and IE default to "inherit". Starting in Chrome 43, the default is "off" and "inherit" is no longer supported. In IE6-10, the value is capitalized.
1222912229
*
@@ -39673,7 +39673,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3967339673
*
3967439674
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/self)
3967539675
*/
39676-
readonly self: Window & typeof globalThis;
39676+
readonly self: Globalized;
3967739677
/**
3967839678
* The **`speechSynthesis`** read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
3967939679
*
@@ -39716,7 +39716,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3971639716
*
3971739717
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/window)
3971839718
*/
39719-
readonly window: Window & typeof globalThis;
39719+
readonly window: Globalized;
3972039720
/**
3972139721
* **`window.alert()`** instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
3972239722
*
@@ -41855,7 +41855,7 @@ declare var scrollbars: BarProp;
4185541855
*
4185641856
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/self)
4185741857
*/
41858-
declare var self: Window & typeof globalThis;
41858+
declare var self: Globalized;
4185941859
/**
4186041860
* The **`speechSynthesis`** read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
4186141861
*
@@ -41898,7 +41898,7 @@ declare var visualViewport: VisualViewport | null;
4189841898
*
4189941899
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/window)
4190041900
*/
41901-
declare var window: Window & typeof globalThis;
41901+
declare var window: Globalized;
4190241902
/**
4190341903
* **`window.alert()`** instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
4190441904
*
@@ -42424,6 +42424,7 @@ type GLsizei = number;
4242442424
type GLsizeiptr = number;
4242542425
type GLuint = number;
4242642426
type GLuint64 = number;
42427+
type Globalized<T = Window> = T & typeof globalThis;
4242742428
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
4242842429
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
4242942430
type HashAlgorithmIdentifier = AlgorithmIdentifier;

baselines/ts5.5/serviceworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10864,7 +10864,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1086410864
*
1086510865
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1086610866
*/
10867-
readonly self: WorkerGlobalScope & typeof globalThis;
10867+
readonly self: Globalized<WorkerGlobalScope>;
1086810868
/**
1086910869
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1087010870
*
@@ -11663,7 +11663,7 @@ declare var onunhandledrejection: ((this: ServiceWorkerGlobalScope, ev: PromiseR
1166311663
*
1166411664
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1166511665
*/
11666-
declare var self: WorkerGlobalScope & typeof globalThis;
11666+
declare var self: Globalized<WorkerGlobalScope>;
1166711667
/**
1166811668
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1166911669
*
@@ -11755,6 +11755,7 @@ type GLsizei = number;
1175511755
type GLsizeiptr = number;
1175611756
type GLuint = number;
1175711757
type GLuint64 = number;
11758+
type Globalized<T = Window> = T & typeof globalThis;
1175811759
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1175911760
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1176011761
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

baselines/ts5.5/sharedworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10397,7 +10397,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1039710397
*
1039810398
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1039910399
*/
10400-
readonly self: WorkerGlobalScope & typeof globalThis;
10400+
readonly self: Globalized<WorkerGlobalScope>;
1040110401
/**
1040210402
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1040310403
*
@@ -11347,7 +11347,7 @@ declare var onunhandledrejection: ((this: SharedWorkerGlobalScope, ev: PromiseRe
1134711347
*
1134811348
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1134911349
*/
11350-
declare var self: WorkerGlobalScope & typeof globalThis;
11350+
declare var self: Globalized<WorkerGlobalScope>;
1135111351
/**
1135211352
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1135311353
*
@@ -11438,6 +11438,7 @@ type GLsizei = number;
1143811438
type GLsizeiptr = number;
1143911439
type GLuint = number;
1144011440
type GLuint64 = number;
11441+
type Globalized<T = Window> = T & typeof globalThis;
1144111442
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1144211443
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1144311444
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

baselines/ts5.5/webworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12351,7 +12351,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1235112351
*
1235212352
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1235312353
*/
12354-
readonly self: WorkerGlobalScope & typeof globalThis;
12354+
readonly self: Globalized<WorkerGlobalScope>;
1235512355
/**
1235612356
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1235712357
*
@@ -13332,7 +13332,7 @@ declare var onunhandledrejection: ((this: DedicatedWorkerGlobalScope, ev: Promis
1333213332
*
1333313333
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1333413334
*/
13335-
declare var self: WorkerGlobalScope & typeof globalThis;
13335+
declare var self: Globalized<WorkerGlobalScope>;
1333613336
/**
1333713337
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1333813338
*
@@ -13432,6 +13432,7 @@ type GLsizei = number;
1343213432
type GLsizeiptr = number;
1343313433
type GLuint = number;
1343413434
type GLuint64 = number;
13435+
type Globalized<T = Window> = T & typeof globalThis;
1343513436
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1343613437
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1343713438
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

baselines/ts5.6/dom.generated.d.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12231,7 +12231,7 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve
1223112231
*
1223212232
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/defaultView)
1223312233
*/
12234-
readonly defaultView: (WindowProxy & typeof globalThis) | null;
12234+
readonly defaultView: Globalized<WindowProxy> | null;
1223512235
/**
1223612236
* **`document.designMode`** controls whether the entire document is editable. Valid values are "on" and "off". According to the specification, this property is meant to default to "off". Firefox follows this standard. The earlier versions of Chrome and IE default to "inherit". Starting in Chrome 43, the default is "off" and "inherit" is no longer supported. In IE6-10, the value is capitalized.
1223712237
*
@@ -39696,7 +39696,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3969639696
*
3969739697
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/self)
3969839698
*/
39699-
readonly self: Window & typeof globalThis;
39699+
readonly self: Globalized;
3970039700
/**
3970139701
* The **`speechSynthesis`** read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
3970239702
*
@@ -39739,7 +39739,7 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler
3973939739
*
3974039740
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/window)
3974139741
*/
39742-
readonly window: Window & typeof globalThis;
39742+
readonly window: Globalized;
3974339743
/**
3974439744
* **`window.alert()`** instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
3974539745
*
@@ -41878,7 +41878,7 @@ declare var scrollbars: BarProp;
4187841878
*
4187941879
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/self)
4188041880
*/
41881-
declare var self: Window & typeof globalThis;
41881+
declare var self: Globalized;
4188241882
/**
4188341883
* The **`speechSynthesis`** read-only property of the Window object returns a SpeechSynthesis object, which is the entry point into using Web Speech API speech synthesis functionality.
4188441884
*
@@ -41921,7 +41921,7 @@ declare var visualViewport: VisualViewport | null;
4192141921
*
4192241922
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/window)
4192341923
*/
41924-
declare var window: Window & typeof globalThis;
41924+
declare var window: Globalized;
4192541925
/**
4192641926
* **`window.alert()`** instructs the browser to display a dialog with an optional message, and to wait until the user dismisses the dialog.
4192741927
*
@@ -42447,6 +42447,7 @@ type GLsizei = number;
4244742447
type GLsizeiptr = number;
4244842448
type GLuint = number;
4244942449
type GLuint64 = number;
42450+
type Globalized<T = Window> = T & typeof globalThis;
4245042451
type HTMLOrSVGImageElement = HTMLImageElement | SVGImageElement;
4245142452
type HTMLOrSVGScriptElement = HTMLScriptElement | SVGScriptElement;
4245242453
type HashAlgorithmIdentifier = AlgorithmIdentifier;

baselines/ts5.6/serviceworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10864,7 +10864,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1086410864
*
1086510865
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1086610866
*/
10867-
readonly self: WorkerGlobalScope & typeof globalThis;
10867+
readonly self: Globalized<WorkerGlobalScope>;
1086810868
/**
1086910869
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1087010870
*
@@ -11663,7 +11663,7 @@ declare var onunhandledrejection: ((this: ServiceWorkerGlobalScope, ev: PromiseR
1166311663
*
1166411664
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1166511665
*/
11666-
declare var self: WorkerGlobalScope & typeof globalThis;
11666+
declare var self: Globalized<WorkerGlobalScope>;
1166711667
/**
1166811668
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1166911669
*
@@ -11755,6 +11755,7 @@ type GLsizei = number;
1175511755
type GLsizeiptr = number;
1175611756
type GLuint = number;
1175711757
type GLuint64 = number;
11758+
type Globalized<T = Window> = T & typeof globalThis;
1175811759
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1175911760
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1176011761
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

baselines/ts5.6/sharedworker.generated.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10397,7 +10397,7 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
1039710397
*
1039810398
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1039910399
*/
10400-
readonly self: WorkerGlobalScope & typeof globalThis;
10400+
readonly self: Globalized<WorkerGlobalScope>;
1040110401
/**
1040210402
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1040310403
*
@@ -11347,7 +11347,7 @@ declare var onunhandledrejection: ((this: SharedWorkerGlobalScope, ev: PromiseRe
1134711347
*
1134811348
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/self)
1134911349
*/
11350-
declare var self: WorkerGlobalScope & typeof globalThis;
11350+
declare var self: Globalized<WorkerGlobalScope>;
1135111351
/**
1135211352
* The **`importScripts()`** method of the WorkerGlobalScope interface synchronously imports one or more scripts into the worker's scope.
1135311353
*
@@ -11438,6 +11438,7 @@ type GLsizei = number;
1143811438
type GLsizeiptr = number;
1143911439
type GLuint = number;
1144011440
type GLuint64 = number;
11441+
type Globalized<T = Window> = T & typeof globalThis;
1144111442
type HashAlgorithmIdentifier = AlgorithmIdentifier;
1144211443
type HeadersInit = [string, string][] | Record<string, string> | Headers;
1144311444
type IDBValidKey = number | string | Date | BufferSource | IDBValidKey[];

0 commit comments

Comments
 (0)