typescript pass object type as parameter