TS1066

error TS1066: In ambient enum declarations member initializer must be constant expression.

Bad Code ❌

1
2
3
4
5
enum PreKeyAuth {
INVALID = 'Invalid',
UNKNOWN = 'Unknown',
VALID = 'Valid'
}

Fixed Code ✔️

1
type PreKeyAuth = 'Invalid' | 'Unknown' | 'Valid';