Commit 31ba71a
committed
Fix generated namespace types in index.d.ts
Previously some namespace types were generated using the legacy `module` keyword from ten years ago. Now we emit the modern TS `namespace` keyword that has been the preferred keyword since TypeScript 1.5 in 2015.
Please review the resulting diff for the generated `dist/index.d.ts` file: https://gist.github.com/robpalme/a320dc3f0cb50bcd14962bca46827dae/revisions
Note that the outer _Ambient Module Declaration_ intentionally remains untouched because it is not a namespace. These are differentiated by using a quoted string rather than a bare identifier
`module "quoted" {`
vs
`module bare {}`
---
Background: This usage of the legacy keyword was found by [a TypeScript real-world test suite](microsoft/TypeScript#61450 (comment)) that checks the compatibility of proposed changes. Using the `module` keyword for namespaces is [proposed for deprecation in TypeScript 6.0](microsoft/TypeScript#54500 (comment)) so it's worth getting ahead of this.1 parent 4e312f3 commit 31ba71a
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments