Skip to content

Commit 59f63d0

Browse files
authored
Merge pull request microsoft#291 from heejongahn/window.open
Change return type of window.open to Window | null (#18132)
2 parents 70fce49 + 9cd24e1 commit 59f63d0

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ The common steps to send a pull request are:
2727

2828
0. Open or refer to an issue in the [TypeScript repo](https://github.com/Microsoft/TypeScript).
2929
1. Add missing elements to `inputfiles/addedTypes.json`, overriding elements to `inputfiles/overridingTypes.json`, or elements to remove to `inputfiles/removedTypes.json`.
30-
2. Run the script locally to obtain new `dom.generated.d.ts` and `webworker.generated.d.ts`.
31-
3. Update the files in the `baselines` folder using the newly generated files.
30+
2. Run the build script locally to obtain new `dom.generated.d.ts` and `webworker.generated.d.ts`.
31+
3. Update the files in the `baselines` folder using the newly generated files
32+
under `generated` folder (`cp ./generated/* ./baseline/`).
3233

3334
### When should a DOM API be included here?
3435

baselines/dom.generated.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13277,7 +13277,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
1327713277
moveBy(x?: number, y?: number): void;
1327813278
moveTo(x?: number, y?: number): void;
1327913279
msWriteProfilerMark(profilerMarkName: string): void;
13280-
open(url?: string, target?: string, features?: string, replace?: boolean): Window;
13280+
open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;
1328113281
postMessage(message: any, targetOrigin: string, transfer?: any[]): void;
1328213282
print(): void;
1328313283
prompt(message?: string, _default?: string): string | null;
@@ -14677,7 +14677,7 @@ declare function matchMedia(mediaQuery: string): MediaQueryList;
1467714677
declare function moveBy(x?: number, y?: number): void;
1467814678
declare function moveTo(x?: number, y?: number): void;
1467914679
declare function msWriteProfilerMark(profilerMarkName: string): void;
14680-
declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window;
14680+
declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;
1468114681
declare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;
1468214682
declare function print(): void;
1468314683
declare function prompt(message?: string, _default?: string): string | null;

inputfiles/overridingTypes.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@
615615
"kind": "method",
616616
"interface": "Window",
617617
"name": "open",
618-
"signatures": ["open(url?: string, target?: string, features?: string, replace?: boolean): Window"]
618+
"signatures": ["open(url?: string, target?: string, features?: string, replace?: boolean): Window | null"]
619619
},
620620
{
621621
"kind": "method",

0 commit comments

Comments
 (0)