-
Type the event handler, not the callback.
Why? Provides better code completion. This can be removed when microsoft/TypeScript#8134 lands.
// Bad export interface MyEventCallback { (event: { ... }): void; } export interface ABC { onMyEvent(callback: MyEventCallback): Disposable; } // Good export interface MyEventHandler { (callback: (event: { ... }) => void): Disposable; } export interface ABC { onMyEvent: MyEventHandler; }