Typescript Infer Type From Array Python