type EnumDictionary<T extends string | symbol | number, U> = { [K in T]: U; }; enum Direction { Up, Down, } const a: EnumDictionary<Direction, number> = { [Direction.Up]: 1, [Direction.Down]: -1 };