How to fix Cannot use conditional type without 'extends' clause in TypeScript | DevErrors