How to fix Type parameter 'X' is not used in the function signature in TypeScript | DevErrors