Types for Dynamic Interaction