How to fix 'this' implicitly has type 'any' because it does not have a type annotation. in TypeScript | DevErrors