I have a codebase that I'm looking to slowly migrate to Typescript. This means I create classes the non-ES6 way using util.inherits from Node, and would like to use JSDoc type annotations rather than converting to Typescript at this time.
But I'm having a problem typing classes:
var util = require("util");
function Base() {
}
/**
* @constructor
* @param {string} arg
*/
function Thing(arg) {
Thing.super_.call(this);
this.x = arg;
}
util.inherits(Thing, Base);
var thing = new Thing("test");
When running Typescript gives the following output:
$ tsc --noEmit --allowJs --checkJs .\test.js
test.js:11:15 - error TS2339: Property 'super_' does not exist on type 'typeof Thing'.
11 Thing.super_.call(this);
~~~~~~
Is there a way to document the super_ property created by inherits using JSDoc?