class Handler { info: string; onClickGood(this: void, e: Event) { // can't use this here because it's of type void! console.log('clicked!'); } } let h = new Handler(); uiElement.addClickListener(h.onClickGood);