Typescript Infer Type From Array To Arraylist