How to fix Index signature parameter type cannot be generic in TypeScript | DevErrors