Use TypeScript type assertions safely to tell the compiler about types it can't infer while avoiding runtime errors.