I'm currently attempting to dynamically inject a method into an external class in TypeScript, but I'm encountering the following error.
Error TS2339: Property 'modifyLogger' does not exist on type 'extclass'.
Here's the code snippet:
extclass['modifyLogger'] = function(mylogger:any){
}
interface extclass{
modifyLogger(): void;
}
let obj = new extclass();
obj.modifyLogger(log);
The above code is resulting in an error message.
Can anyone identify what I might be overlooking here?