I have a code
class Base {
static text: string;
static set(text: string) {
const self = class extends this {};
self.text = text;
return self
}
}
class ChildBase extends Base {
static print(moreText: string) {
return moreText + this.text;
}
}
ChildBase.set('good').print('prefix')
// Error TS2339: Property 'print' does not exist on type 'typeof self'.
How to call print
after the call set
static method. I need clone class before calling another static method in ChildBase