Typescript Check Variable Is File