Some FIX fields employ and quasi-enum type wherein a typical FIX Int or FIX Char is constrained to a list of acceptable values. I have changed how these are represented many times and need to settle.
My favorite (not yet fully implemented) method is to build an object with string keys and string values. The string keys will be constrained with a string union type.
export type ConstrainedKeyValueMap<U extends string> = { [K in U]: string; };
export type TestTypes = 'test1' | 'test2' | 'test3';
// The only acceptable keys are defined in the TestTypes union
export const TEST_TYPES: ConstrainedKeyValueMap<TestTypes> = {
test1: 't1',
test2: 'this is the value for test2 type'
test3: '3'
}