typescript check if type implements interface