Instead of Function (or any ), you can use the following type for the callback parameter:
(ev: Event)=> any
This corresponds to the expected type addEventListener .
Here is the full function signature:
on(eventName: string, callback: (ev: Event)=> any, useCapture: boolean) : Dom.Element { //...
source share