-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScript
Milestone
Description
π Search Terms
jsdoc private constructor
π Version & Regression Information
- This is the behavior in every version I tried back through TS 3.8 where JSDoc support was added, and I reviewed the FAQ for entries about JSDoc
β― Playground Link
π» Code
// foo.js
class Foo {
/**
* @private
*/
constructor() {}
}
new Foo()
// Constructor of class 'Foo' is private and only accessible within the class declaration.(2673)
π Actual behavior
Emits the declaration file:
declare class Foo {
}
π Expected behavior
Should emit the declaration file:
declare class Foo {
/**
* @private
*/
private constructor();
}
Additional information about the issue
I ran into this as it was requested that TypeDoc add a new JSDoc tag to work around this issue. This seems wrong since the declaration file doesn't accurately describe the types within the file, but it's also very unfortunate that it results in the loss of any documentation added to the constructor.
cr7pt0gr4ph7, DayKev and Ginden
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript