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;
onmessageerror: (this: WindowEventHandlers, ev: MessageEvent) => 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 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: (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;
onmessageerror: (this: WindowEventHandlers, ev: MessageEvent) => 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 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
- WindowEventHandlers (View Summary)
Index
Properties
Methods
Properties
onafterprint
onbeforeprint
onbeforeunload
ongamepadconnected
ongamepaddisconnected
onhashchange
onlanguagechange
onmessage
onmessageerror
onoffline
ononline
onpagehide
onpageshow
onpopstate
onrejectionhandled
onstorage
onunhandledrejection
onunload
Methods
addEventListener
- 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
removeEventListener
- 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
Returns void
MDN Reference