webdoc-labs / webdoc

Documentation generator for the web
https://www.webdoclabs.com
Other
79 stars 9 forks source link

TypeScript doesn't infer type or readonly from getter #110

Closed bigtimebuddy closed 3 years ago

bigtimebuddy commented 3 years ago

Detection of the getter's return type and readonly (no setter) not working.

/** Get the duration of the audio in seconds. */
public get duration(): number
{
    return this._duration;
}

Workaround is to explicitly add the type.

/**
 * Get the duration of the audio in seconds.
 * @type {number}
 * @readonly
 */
public get duration(): number
{
    return this._duration;
}
ShukantPal commented 3 years ago

Got bit by this, will have to fix