Typedoc: No reflection on object literals

Created on 14 Nov 2018  路  9Comments  路  Source: TypeStrong/typedoc

From TypeDoc src\lib\utils\component.ts:
const childMappings: {host: ChildableComponent<any, any>, child: Function}[] = [];

Generates:
image

No information on the object literal, just _object_.

Likewise on this example:
/** Email details */
public email?: { id: string, isVerified?: boolean }

Generates:
image

Again, just _object_. Is it possible to get reflection information on the object literal?

bug

Most helpful comment

This has been fixed in 0.16

image

All 9 comments

It's partly working. See below:

default

And my test code to produce docs is this:

class Test {
    public email?: { id: string, isVerified?: boolean }
}

const childMappings: {host: number, child: Function}[] = [];

const test2 = {
    hi: "hi",
    test: "test"
}

We can see that email property is shown with its own object properties. Am I reproducing something wrong, or is typedoc updated to make some changes on this matter?

On the other hand, childMappings would be rendered the same as what @williamkbentley suggested:
image

So I really don't know what's happening here. I need some more verification...!? @williamkbentley

I think narrowed part of the issue down to --excludeNotExported. When that option is on the object literal properties are not included:
image

Same class without --excludeNotExported:
image

Using v0.14.0

Weird :worried:
I will have a look at this if I have some time.

Are there any news guys? I face the same problem and here is a minimal reproduction:

Test code

export interface MyEvent<Type extends string, Payload> {
  type: Type;
  payload?: Payload;
}

export type FooEvent = MyEvent<'foo', {
  some: string;
  data: number;
}>

typedoc.json

{
  "src": [
    "./test.ts"
  ],
  "mode": "file",
  "module": "umd",
  "target": "es5",
  "out": "docs"   
}

Generated docs

image

It would be great to see a list of properties for payload e.g.

Payload
some: string
data: number

This has been fixed in 0.16

image

I'm still having this issue with @next (typedoc@^0.17.0-3) with the new --mode library option:

export type TOptions = string | {number?: number; [target: string]: any};

Generated:

TOptions
片 TOptions: string | object

Config:

"typedoc": "typedoc --out packages/site/docs/api packages/core/src/index.ts --mode library --readme none --excludePrivate --plugin typedoc-plugin-markdown --theme docusaurus2",

Huh, that's weird, I would have expected it to render string | { number?: number } (the themes don't handle index signatures correctly yet, need to open a bug for that)

I can't reproduce with the default theme - this seems to be a bug with typedoc-plugin-markdown.

Thanks, I'll report an issue there instead

Was this page helpful?
0 / 5 - 0 ratings