Typescript Define Type From Array To Hashmap