Adding Window.event Handler To Typescript
Answer :
This
window.addEventListener('keydown', keyDownListener, false)
window
is defined will all events in lib.d.ts
and this particular listener as
addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void;
or this, if you want to keep your original "style",
window.onkeydown = (ev: KeyboardEvent): any => { //do something }
Comments
Post a Comment