Closed
Description
π Search Terms
jsdoc overloads compiler declaration class function
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about overloads, classes, et al.
β― Playground Link
π» Code
/**
* This documentation is properly in the .d.ts
*/
class Foo {
/**
* The good signature
*/
foo(bar: string): void;
/**
* @depreacted This signature is depreacted
*/
foo(): string;
foo(bar?: string): string | void {
return 'hi';
}
}
/**
* The documentation in .d.ts is bad
*/
function MakeBar() {
return class Bar {
/**
* The good signature
*/
foo(bar: string): void;
/**
* @deprecated This signature is deprecated
*
* This signature is missing from the .d.ts
*/
foo(): string;
foo(bar?: string): string | void {
return 'hi'
}
}
}
π Actual behavior
The jsdoc in the d.t.s
file duplicates the jsdoc for the first signature found on all other overloaded signatures when a function returns a constructor. This behavior does not appear in normal class definitions.
π Expected behavior
The JSDoc on each signature should match what's written for that signature in the .ts
file.
Additional information about the issue
Intellisense that's picked up directly from the .ts
file works fine - it understands the difference between the signatures, it's only the declaration file that's broken.