diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index 980c65030..3000ec309 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -17230,7 +17230,8 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler readonly pageXOffset: number; /** @deprecated This is a legacy alias of `scrollY`. */ readonly pageYOffset: number; - readonly parent: WindowProxy | null; + /** Refers to either the parent WindowProxy, or itself. It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent. */ + readonly parent: WindowProxy; /** * Returns true if the personal bar is visible; otherwise, returns false. */ @@ -18294,7 +18295,8 @@ declare var outerWidth: number; declare var pageXOffset: number; /** @deprecated This is a legacy alias of `scrollY`. */ declare var pageYOffset: number; -declare var parent: WindowProxy | null; +/** Refers to either the parent WindowProxy, or itself. It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent. */ +declare var parent: WindowProxy; /** * Returns true if the personal bar is visible; otherwise, returns false. */ diff --git a/deploy/migrate.js b/deploy/migrate.js index 0433d8884..1a872f611 100644 --- a/deploy/migrate.js +++ b/deploy/migrate.js @@ -15,15 +15,17 @@ if (!tscWD) ); const generatedFiles = readdirSync("generated"); -generatedFiles.forEach((file) => { - if (file == ".DS_Store") return; +const filesToSend = generatedFiles.filter( + (file) => file.includes("dom.") || file.includes("webworker.") +); +filesToSend.forEach((file) => { const contents = readFileSync(join("generated", file), "utf8"); const newFilePath = join(tscWD, "src", "lib", file); writeFileSync(newFilePath, contents); }); console.log( - `Moved ${generatedFiles + `Moved ${filesToSend .map((f) => f.replace(".generated", "")) .join(", ")} to '${tscWD}/src/lib'.` ); diff --git a/inputfiles/comments.json b/inputfiles/comments.json index 7920d6f86..ed5bb2782 100644 --- a/inputfiles/comments.json +++ b/inputfiles/comments.json @@ -1796,6 +1796,15 @@ } } } + }, + "Window": { + "properties": { + "property": { + "parent": { + "comment" : "Refers to either the parent WindowProxy, or itself. It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent." + } + } + } } } } diff --git a/inputfiles/overridingTypes.jsonc b/inputfiles/overridingTypes.jsonc index 0d552dd97..5bf3cc46e 100644 --- a/inputfiles/overridingTypes.jsonc +++ b/inputfiles/overridingTypes.jsonc @@ -500,6 +500,9 @@ }, "window": { "overrideType": "Window & typeof globalThis" + }, + "parent": { + "nullable": false } } },