Given a simple enum
:
export enum IconNames {
DEFAULT = 'DEFAULT',
MOVE = 'MOVE',
RESIZE = 'RESIZE',
ADD = 'ADD',
CANCEL = 'CANCEL',
CLOSE = 'CLOSE',
}
I would like to type the name
argument in the given function isTransform
so I would call it only with IconNames
value:
/* Tried `string` which doesn't work
as `name` supposed to be enum's value */
const isTransform = (name: any) => [IconNames.MOVE, IconNames.RESIZE, IconNames.ADD].includes(name);
Do I have to build an interface for it? How do I use it?