typedoc icon indicating copy to clipboard operation
typedoc copied to clipboard

Generated documentation doesn't display the content of array of objects

Open SofiaP opened this issue 9 years ago • 6 comments

I have this example:

interface example {
  obj: {
    property: string
  }[];
}

And the output of the content of 'obj' is:

image

Is it possible to make it display the inner contents of the object array?

SofiaP avatar May 31 '17 17:05 SofiaP

@SofiaP What do you imagine the output looking like? I tend to think it would be better to define the interface of that object separately so that it can be referenced independently.

aciccarello avatar Jun 05 '17 14:06 aciccarello

If I define the obj like an interface this would work, but in some cases I don't need to reference the interface multiple times, and it would be nice to view the content of the object. If I do not use an array I will see the object, I don't understand why when I use an array of objects I can't see the object rendered,

I would expect to view the property rendered like:

obj: { property: string }[]

SofiaP avatar Jun 05 '17 16:06 SofiaP

Has there been any solution or workaround for this?

kal93 avatar Nov 14 '17 12:11 kal93

@kal93 A workaround would be to define the object interface

interface example {
  obj: ObjectDefinition[];
}

interface ObjectDefinition {
  property: string;
}

aciccarello avatar Nov 14 '17 15:11 aciccarello

It looks like something goes wrong in new releases. This example parsed by TypeDoc 0.5.10 appears like this:

Properties obj: object [] Type declaration

  • property: string

apsheni avatar Mar 07 '18 06:03 apsheni

In recent versions of TypeDoc, we render objects more reasonably:

image

Gerrit0 avatar Nov 28 '20 18:11 Gerrit0