28.7 Typing Third-Party Hooks
Alright, let’s talk about the real world. You’re not just writing your own beautiful, perfectly typed hooks; you’re also going to be using other people’s. And let’s be honest, some of those people might have been having a very long day when they wrote the type definitions. Our job is to build a sturdy, type-safe scaffold around their code, even when it feels like they’re actively working against us. The golden rule here is simple: Never use any to shut the compiler up. That’s like fixing a gas leak by removing the smoke alarm. We’re better than that. We’re going to understand what we’re dealing with and apply the correct level of type safety.