react-docgen icon indicating copy to clipboard operation
react-docgen copied to clipboard

Are there any TypeScript typings for this library?

Open matyasf opened this issue 2 years ago • 2 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!

matyasf avatar Mar 08 '22 13:03 matyasf

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

IanVS avatar Apr 04 '22 13:04 IanVS

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

danez avatar Apr 04 '22 14:04 danez

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?

lmiller1990 avatar Dec 02 '22 04:12 lmiller1990

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

danez avatar Dec 16 '22 02:12 danez