This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Description
When we compare the exported properties of a declaration and JS source, we ignore the prototype property. This means that if the module is a class, we don't compare the class members to see if they match. For example:
js
class C {
constructor(x) {
this.x = x;
}
name() {
return `x: ${this.x}`;
}
}
module.exports = C;
d.ts
declare class C {
x: number;
constructor(x: number);
}
export = C;
We don't detect that name method is missing from the d.ts because we ignore the members of prototype in the JS inferred module type. To account for name, we should do something like
jsExportType.members.get("prototype").type.getProperties(); // returns symbols for properties 'x' and 'name' above