typescript check type implements interface