-
Hello! I'm trying to debug an issue in my project using Typedoc where a conditional type is getting resolved to So I'm documenting a React hook which has its return type in another package. The return type is a union and one of the keys ( However, the generated JSON resolves it to {
"id": 7080,
"name": "useAuth",
"variant": "declaration",
"kind": 64,
"flags": {},
"signatures": [
{
"id": 7081,
"name": "useAuth",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": []
},
"parameters": [
{
"id": 7082,
"name": "initialAuthState",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "An object containing the initial authentication state. If not provided, the hook will attempt to derive the state from the context."
}
]
},
"type": {
"type": "intrinsic",
"name": "any"
},
"defaultValue": "{}"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 7083,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 7103,
"name": "orgRole",
"variant": "declaration",
"kind": 1024,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The current user's role in their active organization."
}
]
},
"type": {
"type": "intrinsic",
"name": "any"
}
}, I made the JSON snippet more concise by only showing the relevant bit. So far I fail to reproduce it. Both in a simple case (https://stackblitz.com/edit/sb1-m67b1mfh?file=src%2Findex.ts) and with monorepo (https://stackblitz.com/edit/github-kirzw2eo?file=package.json). So what am I'm missing that it doesn't work in my project? I do generate |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I suspect this is to do with the union type -- before #2920 was fixed (not yet released, this weekend probably) TypeDoc didn't handle anything tagged with |
Beta Was this translation helpful? Give feedback.
I suspect this is to do with the union type -- before #2920 was fixed (not yet released, this weekend probably) TypeDoc didn't handle anything tagged with
@inline
which wasn't a simple object type. If I install the current master branch of typedoc, comment out all your plugins (thank you for putting plugin config in separate objects! That made it super easy to do) and run, I get the following signature: