typescript check if implements interface