I have method export const getMatchPicks = (match: IMatch, ends: EndType[]): IPick[] => ends.map(end => matchToPick(match, end));
Also, I have:
enum EndType {
HOME = 'home',
DRAW = 'draw',
AWAY = 'away',
}
My goal call getMatchesPicksList function passing EndType enums as array:
getMatchesPicksList(matches, [EndType.HOME, EndType.AWAY, EndType.DRAW])
The code above has been compiled correctly. But what if I will have n length enum? How to pass it to function?
I expect something like getMatchesPicksList(matches, EndType) , but it returns:
error TS2345: Argument of type 'typeof EndType' is not assignable to parameter of type 'EndType[]'. Property 'includes' is missing in type 'typeof EndType'.