collectype / types/utility / EnumOrString
EnumOrString<
E> =E[keyofE] |E[keyofE]
Defined in: types/utility.ts:78
Helper type to allow either an enum member or its string value.
E extends Record<string, string>
The enum type (must be a string-valued enum).
enum E { A = 'a', B = 'b' }
type Example = EnumOrString<E>; // 'a' | 'b'