I am using a JavaScript module to extend a Class for a Custom extended Class.
I have written my Custom Class in TypeScript, but I encountered the following error messages:
Property 'jsFunc' does not exist on type 'tsClass'.ts(2339)
I believe this issue arises because JavaScript Class lacks type information, meaning it cannot access any properties.
How can I address this problem correctly?
For example:
book.js
class book {
page;
constructor(page) {
this.page = page;
}
open() {
_next();
}
_next() {
this.page = this.page++;
}
}
comicbook.ts
class comicbook extends book {
page; // if it isn't It would be error that does not exist
open() {
this.page = 10;
_next(); // Property '_next()' does not exist on type 'commicbook'.ts
}
}