diff --git a/scripts/dtsBundler.mjs b/scripts/dtsBundler.mjs index 305172d3199e1..b17d32ead8b18 100644 --- a/scripts/dtsBundler.mjs +++ b/scripts/dtsBundler.mjs @@ -400,10 +400,11 @@ function emitAsNamespace(name, moduleSymbol) { emitAsNamespace("ts", moduleSymbol); write("export = ts;", WriteTarget.Both); +write("export as namespace ts;", WriteTarget.Both); const copyrightNotice = fs.readFileSync(path.join(__dirname, "CopyrightNotice.txt"), "utf-8"); -const publicContents = copyrightNotice + publicLines.join(newLine); -const internalContents = copyrightNotice + internalLines.join(newLine); +const publicContents = copyrightNotice + publicLines.join(newLine) + newLine; +const internalContents = copyrightNotice + internalLines.join(newLine) + newLine; if (publicContents.includes("@internal")) { console.error("Output includes untrimmed @internal nodes!"); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 760a948efc21a..1c385ae2ce029 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -11064,4 +11064,5 @@ declare namespace ts { */ function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; } -export = ts; \ No newline at end of file +export = ts; +export as namespace ts; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 85d2a5b10a201..b80d7c269bc82 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -7194,4 +7194,5 @@ declare namespace ts { */ function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; } -export = ts; \ No newline at end of file +export = ts; +export as namespace ts;