-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type metadata lost in mapped types #21489
Comments
|
This appears to be fixed, at least since version 3.1.6: demo |
It does seem like this issue is fixed! Maybe by accident or part of some other work. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are using
typedoc
and noticed type metadata that drives the docs is lost when mapped types are used. It may be possible for mapped types to invalidate metadata (maybe@example
for instance). Metadata like description should still hold true from a mapped type.Maybe this is an intentional design choice, but it seems in many cases this metadata can be very useful even if passed through mapped types. Many libraries use mapped types like
Pick
orOmit
which don't actually change metadata relevance.TypeScript Version: typescript@2.8.0-dev.20180130
Search Terms:
pick mapped types
mapped types jsdoc
jsdoc mapped
jsdoc types
mapped types meta
mapped types meta data
Code
Expected behavior:
Type metadata follows the result of mapped types
Actual behavior:
All metadata is lost
Playground Link:
You'll have to put the cursor on the
bar
offoo.bar
and hitCtrl+Space
to see the Intellisensehttps://www.typescriptlang.org/play/#src=interface%20Foo%20%7B%0D%0A%20%20%2F**%20some%20doc%20*%2F%0D%0A%20%20bar%3A%20string%0D%0A%7D%0D%0A%0D%0Aconst%20foo%3A%20Foo%20%3D%20%7B%0D%0A%20%20bar%3A%20'baz'%0D%0A%7D%0D%0A%0D%0Afoo.bar%20%2F%2F%20description%3A%20%22some%20doc%22%20%0D%0A%0D%0Atype%20Foo2%20%3D%20Pick%3CFoo%2C%20'bar'%3E%0D%0A%0D%0Aconst%20foo2%3A%20Foo2%20%3D%20%7B%0D%0A%20%20bar%3A%20'baz'%0D%0A%7D%0D%0A%0D%0Afoo2.bar%20%2F%2F%20description%20lost
Related Issues:
The text was updated successfully, but these errors were encountered: