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