reactjs/react-docgen

Are there any TypeScript typings for this library?

matyasf opened this issue · 4 comments

I'm struggling with typing the output of this library, has someone already done so? The only thing I've found was in the Readme, but its very vague , e.g. "elements": [{ <element-type> } -- what is here <element-type>? Has someone already typed the output? Thanks!

IanVS commented

I believe that much of the code has been converted to typescript in the main branch, but has not yet been released.

danez commented

There is now version v6.0.0-alpha.1 which is the first pre-release with typescript typings included.

Thanks @danez - I'm trying out alpha.3, I'm noticing the return types for parse are not quite correct - they seem to indicate DocumentationObject, but in reality I get an object with:

[ { description: '', displayName: 'Counter', methods: [ [Object] ] } ]

I'm guessing this will be fixed in a future release - anything I can do to help out?

danez commented

This has changed now in 6.0.0-alpha.4 parse() now always returns Documentation[].