typescript check type against interface