Declaration emit redundantly inlines optional union parameters #42165
Labels
Domain: Declaration Emit
The issue relates to the emission of d.ts files
Fix Available
A PR has been opened for this issue
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Milestone
Bug Report
🔎 Search Terms
inlining duplication declaration emit optional union parameters
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
DTS emit expands the definition of the union for the optional parameter.
🙂 Expected behavior
DTS emit should treat it the same as a mandatory parameter and reference it by name.
Related Issues
This is a very specific instance of the issue of declarations inlining types. I'm raising it because it looks like a pure win to simplify emitted DTS files. Fixing this will make other userland tricks to simplify types more effective.
If fixing this is contentious, or requires a large overhaul, please feel free to immediately close. I will not be offend because I realize there is a long tail of issues in this space and do not wish to create noise.
The text was updated successfully, but these errors were encountered: