typedoc
typedoc copied to clipboard
Constructor property parameters are not documented when --excludeNotDocumented is on
Search Terms
constructor parameter property documentation
Problem
When using --excludeNotDocumented, a class that declares properties in the constructor the properties do not seem to be documented correctly even with @param.
class X {
/**
* Instantiates X.
* @param prop The property of X.
*/
constructor(readonly prop: number) {
}
}
Suggested Solution
This is not a suggestion, but a bug. Sorry for the wrong labelling.
@SamuraiJack you might be interested in this
Thanks for the report, I'll check soon
Can not reproduce this one. I'm testing with this class definition:
/**
* Has docs
*/
export class BaseClass {
/**
* Has docs
*/
some : number
// no docs
protected kind: number;
/**
* Has docs
*/
static instance: BaseClass;
// no docs
static instances: BaseClass[];
/**
* Has docs
* @param name
*/
constructor(readonly name: string){
}
}
And the result is:

The constructor seems to be properly documented.
Command line:
node ../../bin/typedoc --includes inc/ --media media/ --target ES5 --json json.json --out doc/ src/ --excludeNotDocumented
@judax Any additional info?
@judax Perhaps you did not include the docs for the class itself? Then the whole class won't be included.
Your test works but I still cannot make my code work:
/** Represents a 2 float structure (i.e. a point in 2D). */
export class Float2 {
/**
* Constructs a 2 float structure instance.
*
* @param x The x component of the 2 float structure.
* @param y The y component of the 2 float structure.
*/
constructor(readonly x: number, readonly y: number) {}
}
Here are my command line options:
typedoc --excludeNotDocumented --ignoreCompilerErrors --excludePrivate --excludeProtected --readme none --mode file --theme MY_DEFAULT_THEME_PATH
Ok, thanks for the info!
Seems to me related to #584.
It also seems to me that there is no way to add Documentation to the auto-generated Properties (only the Parameters):
/** KvStore implements ...
*/
export class KvStore implements IKvStore {
/** Generate a KvStore instance for a specific [[Datastore]] instance.
...
@param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.
@param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.
*/
constructor(readonly datastore: Datastore, readonly projectId?: string) {
assertIsObject(datastore)
}
