JSDoc: unable to define an optional method on base class #24470
Labels
Bug
A bug in TypeScript
checkJs
Relates to checking JavaScript using TypeScript
Domain: JSDoc
Relates to JSDoc parsing and type generation
Milestone
TypeScript Version: 2.8.3
We have a base "abstract" (this is plain JS) class that defines an
ExtensionAPI
which extensions need to extend to provide the implementation. Some of the methods (likestartup
) are optional, and if not present, we can delay initializing the extensions on startup.Typescript check complains that the base class doesn't have such methods, and the best solution I could figure out is to add a property to the
ExtensionAPI.prototype
and properly@type
it, but that throws with error TS2425.Code
Typecheck using:
Actual behavior:
The text was updated successfully, but these errors were encountered: