typescript check if variable is interface type