typescript conditional type based on enum value