You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing a library that relies heavily on decorators in typescript, it would be beneficial if decorator information could be somehow preserved in the generated *.d.t.s file. I don't have any suggestion how it could be done except for maybe just code comments containing the original decorator.
Decorators as they stand today have no impact on the type. they are more of an implementation detail if you may. thus keeping them in the declaration file is not correct. moreover, a decorator depends on expressions, e.g. @Construct( myVariable ) having that in your declaration file is a bit meaningless, since the value of myVariable is known only at runtime.
We do have a proposal for a design-time decorator, that acts more like comments in this case, and these would be trafficked to the generated .d.ts, see more in #2900
When writing a library that relies heavily on decorators in typescript, it would be beneficial if decorator information could be somehow preserved in the generated *.d.t.s file. I don't have any suggestion how it could be done except for maybe just code comments containing the original decorator.
Currently code like this
could generate this:
Since I'm writing a IDE plugin, I could read that comment to help me with looking up methods that satisfy particular criteria in a published library.
The text was updated successfully, but these errors were encountered: