diff --git a/src/__tests__/events.js b/src/__tests__/events.js index 8f8ea563..20d01b0d 100644 --- a/src/__tests__/events.js +++ b/src/__tests__/events.js @@ -76,6 +76,11 @@ const eventTypes = [ events: ['load', 'error'], elementType: 'img', }, + { + type: '', + events: ['offline', 'online'], + elementType: 'window', + }, { type: '', events: ['load', 'error'], diff --git a/src/event-map.js b/src/event-map.js index c2bcfaf3..30e4f9d0 100644 --- a/src/event-map.js +++ b/src/event-map.js @@ -363,6 +363,15 @@ export const eventMap = { EventType: 'PopStateEvent', defaultInit: {bubbles: true, cancelable: false}, }, + // window events + offline: { + EventType: 'Event', + defaultInit: {bubbles: false, cancelable: false}, + }, + online: { + EventType: 'Event', + defaultInit: {bubbles: false, cancelable: false}, + }, } export const eventAliasMap = { diff --git a/types/events.d.ts b/types/events.d.ts index 04095380..57a7edd6 100644 --- a/types/events.d.ts +++ b/types/events.d.ts @@ -86,6 +86,8 @@ export type EventType = | 'pointerLeave' | 'gotPointerCapture' | 'lostPointerCapture' + | 'offline' + | 'online' export type FireFunction = ( element: Document | Element | Window | Node,