How to fix Type 'X' is not assignable to template literal type 'Y' in TypeScript | DevErrors