Last signature is missing when multiple are defined
See original GitHub issueSearch terms
- signature
- missing
Expected Behavior
If I scan a method with multiple signatures, then I expect all of them to be present in the typedoc.json/reflection data.
Actual Behavior
The last one is always missing. I need that at least for the default value.
Steps to reproduce the bug
export class SignatureTest {
/**
* Test with multiple signatures.
*
* @param a The value to return.
*/
multiSignature(a: boolean): boolean;
multiSignature(a: number): number;
multiSignature(a: unknown = 1): unknown {
return a;
}
}
typedoc.json
{
"id": 0,
"name": "@faker-js/faker",
"kind": 1,
"kindString": "Project",
"flags": {},
"originalName": "",
"children": [
{
"id": 1,
"name": "SignatureTest",
"kind": 128,
"kindString": "Class",
"flags": {},
"children": [
[...]
{
"id": 4,
"name": "multiSignature",
"kind": 2048,
"kindString": "Method",
"flags": {},
"sources": [...]
"signatures": [
{
"id": 5,
"name": "multiSignature",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"comment": {
"shortText": "Test with multiple signatures."
},
"parameters": [
{
"id": 6,
"name": "a",
"kind": 32768,
"kindString": "Parameter",
"flags": {},
"comment": {
"shortText": "The value to return.\n"
},
"type": {
"type": "intrinsic",
"name": "boolean"
}
}
],
"type": {
"type": "intrinsic",
"name": "boolean"
}
},
{
"id": 7,
"name": "multiSignature",
"kind": 4096,
"kindString": "Call signature",
"flags": {},
"parameters": [
{
"id": 8,
"name": "a",
"kind": 32768,
"kindString": "Parameter",
"flags": {},
"type": {
"type": "intrinsic",
"name": "number"
}
}
],
"type": {
"type": "intrinsic",
"name": "number"
}
},
+ {
+ "id": 9,
+ "name": "multiSignature",
+ "kind": 4096,
+ "kindString": "Call signature",
+ "flags": {},
+ "parameters": [
+ {
+ "id": 10,
+ "name": "a",
+ "kind": 32768,
+ "kindString": "Parameter",
+ "flags": {},
+ "type": {
+ "type": "intrinsic",
+ "name": "unknown"
+ },
+ "defaultValue": "1"
+ }
+ ],
+ "type": {
+ "type": "intrinsic",
+ "name": "unknown"
+ }
+ }
]
}
],
[...]
}
],
[...]
}
Environment
- Typedoc version:
~0.22.12
- TypeScript version:
~4.6.2
- Node.js version:
v16.14.0
- OS:
Windows 11
- Related:
- #1879 - Jsdocs comments only present on first signature
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
MS Outlook signatures disappeared or missing after Office ...
I have lost access to all my previous signatures and when I try and recreate a signature with the same name, I am...
Read more >TypeScript: Index signature is missing in type - Stack Overflow
The problem is that when the type is inferred, then the type of o is: { dic: { a: number, b: number }...
Read more >Signatures are not added - CodeTwo
Another reason to why signatures are not added may be related to complex conditions defined for a particular rule. If you are adding...
Read more >How do I Resolve the "At least one signature has problems ...
What does the error message mean? · The error message at the top of Adobe Reader says that something is wrong with the...
Read more >Complying with Medicare Signature Requirements - CMS
How do we define a handwritten signature? ... If your signature is missing from the medical record (other than an order), send an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s going to depend on what you mean by “complete”. Default values are an arbitrary expression, there’s no guarantee that they are a simple value… so it really depends on your use case. The simplest way to do this is, of course, to just get the text from the source file. This will put the default parameters in the JSON as strings from the source file, or
null
if a parameter doesn’t have a default value.Thanks for this example. I added this to our project in https://github.com/faker-js/faker/pull/656