Typescript Variable With Two Possible Types Of Flow