How to properly type a callback function in a TypeScript method parameter?
Hello everyone! I'm just starting to learn TypeScript and ran into a problem. My class has a method that accepts a callback function. I want to type the parameter so that any function (with any number of arguments and return value) can be passed, but without using `any` to preserve type checking.\n\nHere's what I'm trying:\n\n```typescript\nclass EventBus {\n on(eventName: string, callback: any) { // this works, but it's unsafe\n // ...\n }\n}\n\nconst bus = new EventBus();\nbus.on('click', (data: number) => console.log(data)); // no error even if you pass a string\n```\n\nI understand that `any` disables type checking completely and it's a bad practice. I tried using `Function`, but it's also too broad and doesn't allow proper type checking.