doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.6k stars 1.46k forks source link

Props of TypeScript Shape? #1625

Open designbyadrian opened 3 years ago

designbyadrian commented 3 years ago

Can I output the props of a TypeScript shape (type or interface)?

Let's say I've got this component:

interface IItem {
  key: string;
  value: string;
}

type MyComponentProps = {
  items: IItem[];
}

function MyComponent({ items }): MyComponentProps {
  render <div></div?
}

If I use the docz Props component in my mdx file, I get this output:

<Props of={MyComponent} />
items  IItem[]

Is there a way to automatically render the IITem interface so that readers can understand how this array should look?