I have this Enum:
export enum EntityTypes {
VALUE = 'value',
OTHER = 'other',
}
and this type:
export type ValueEntity = {
entityType: EntityTypes.VALUE
}
and this func:
const myFunc = (entity: ValueEntity) => {}
If I do:
myFunc({ entityType: EntityTypes.VALUE })
I get the error: Type 'EntityTypes' is not assignable to type 'EntityTypes.VALUE'.
If I do
myFunc({ entityType: EntityTypes.VALUE as EntityTypes.VALUE })
it works but that's an ugly workaround...