Support ~
namespace qualifier in JS Doc type positions
#47199
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Bug Report
I'm using
tsc
to create a.d.ts
file from jsdoc comments in my JavaScript source files. When I scope a custom type definition using the "~" character, if the parameter is optional, it will not be in the outputted.d.ts
.According to jsdoc documentation, this is the correct way to scope a callback to a specific class.
💻 Code
JavaScript source:
Outputted
.d.ts
file:🙁 Actual behaviour
The output renders "callback" as if mandatory. This is invalid as a mandatory parameter cannot follow an optional one. Also, the type is "any", event though I defined a custom type.
🙂 Expected behaviour
The "callback" parameter should be optional as specified in the source JavaScript. The type should be "Test~myCallback" (or however TypeScript deals with these).
The text was updated successfully, but these errors were encountered: