Typescript Infer Type From Array Of Objects