TypeScript声明回调函数类型,例如:
event.on('change', function() {});
声明一个专用的函数类型就可以了:
type Cb = () => void; on(type: string, cb: Cb);