Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class Original {
- constructor() {}
- get info() {return 'X';}
- getData(key: this['info']) {}
- setData(key: this['info'], value ) {}
- }
- class MyClass extends Original {
- get info() {return 'A' as 'A';}
- }
- class MyOtherClass extends Original {
- get info() {return 'B' as 'B';}
- }
- const myInstance = new MyClass();
- console.log(myInstance.getData('A'));
- const myOtherInstance = new MyOtherClass();
- console.log(myOtherInstance.getData('B'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement