Interface WindowEventHandlers
interface WindowEventHandlers {
onafterprint: ((this: WindowEventHandlers, ev: Event) => any);
onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any);
onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any);
ongamepadconnected: ((this: WindowEventHandlers, ev: GamepadEvent) => any);
ongamepaddisconnected: ((this: WindowEventHandlers, ev: GamepadEvent) => any);
onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any);
onlanguagechange: ((this: WindowEventHandlers, ev: Event) => any);
onmessage: ((this: WindowEventHandlers, ev: MessageEvent<any>) => any);
onmessageerror: ((this: WindowEventHandlers, ev: MessageEvent<any>) => any);
onoffline: ((this: WindowEventHandlers, ev: Event) => any);
ononline: ((this: WindowEventHandlers, ev: Event) => any);
onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any);
onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any);
onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any);
onrejectionhandled: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any);
onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any);
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any);
onunload: ((this: WindowEventHandlers, ev: Event) => any);
addEventListener<K>(type: K, listener: ((this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K>(type: K, listener: ((this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any), options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
onafterprint: ((this: WindowEventHandlers, ev: Event) => any);
onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any);
onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any);
ongamepadconnected: ((this: WindowEventHandlers, ev: GamepadEvent) => any);
ongamepaddisconnected: ((this: WindowEventHandlers, ev: GamepadEvent) => any);
onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any);
onlanguagechange: ((this: WindowEventHandlers, ev: Event) => any);
onmessage: ((this: WindowEventHandlers, ev: MessageEvent<any>) => any);
onmessageerror: ((this: WindowEventHandlers, ev: MessageEvent<any>) => any);
onoffline: ((this: WindowEventHandlers, ev: Event) => any);
ononline: ((this: WindowEventHandlers, ev: Event) => any);
onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any);
onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any);
onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any);
onrejectionhandled: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any);
onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any);
onunhandledrejection: ((this: WindowEventHandlers, ev: PromiseRejectionEvent) => any);
onunload: ((this: WindowEventHandlers, ev: Event) => any);
addEventListener<K>(type: K, listener: ((this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any), options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K>(type: K, listener: ((this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any), options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
Hierarchy
- WindowEventHandlers (view full)
Index
Properties
Methods
Properties
onafterprint
onbeforeprint
onbeforeunload
ongamepadconnected
ongamepaddisconnected
onhashchange
onlanguagechange
onmessage
onmessageerror
onoffline
ononline
onpagehide
onpageshow
onpopstate
onrejectionhandled
onstorage
onunhandledrejection
onunload
Methods
addEventListener
- add
Event <K>(type, listener, options?): voidListener Type Parameters
- K extends keyof WindowEventHandlersEventMap
Parameters
- type: K
- listener: ((this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any)
- (this, ev): any
Parameters
- this: WindowEventHandlers
- ev: WindowEventHandlersEventMap[K]
Returns any
Optional
options: boolean | AddEventListenerOptions
Returns void
- add
Event (type, listener, options?): voidListener Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optional
options: boolean | AddEventListenerOptions
Returns void
removeEventListener
- remove
Event <K>(type, listener, options?): voidListener Type Parameters
- K extends keyof WindowEventHandlersEventMap
Parameters
- type: K
- listener: ((this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any)
- (this, ev): any
Parameters
- this: WindowEventHandlers
- ev: WindowEventHandlersEventMap[K]
Returns any
Optional
options: boolean | EventListenerOptions
Returns void
- remove
Event (type, listener, options?): voidListener Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optional
options: boolean | EventListenerOptions
Returns void
MDN Reference