How to fix Returned expression type is not assignable to return type in TypeScript | DevErrors