https://github.com/eddyerburgh/dom-event-types
DOM event data scraped from MDN
https://github.com/eddyerburgh/dom-event-types
Last synced: about 1 year ago
JSON representation
DOM event data scraped from MDN
- Host: GitHub
- URL: https://github.com/eddyerburgh/dom-event-types
- Owner: eddyerburgh
- License: mit
- Created: 2018-09-22T19:42:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-07T06:01:00.000Z (over 3 years ago)
- Last Synced: 2025-03-27T15:47:32.150Z (over 1 year ago)
- Language: TypeScript
- Size: 415 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# dom-event-types
An object of DOM event types and their interfaces.
Data scraped from MDN.
## Usage
```shell
npm install --save-dev dom-event-types
```
```js
const eventInterfaces = require("dom-event-interfaces");
console.log(eventInterfaces);
//=> { "abort": { "eventInterface": "Event", "bubbles": false, "cancelable": false }, ... }
```
## Shape
```ts
{
[eventType]: {
eventInterface: string
cancelable: Boolean
bubbles: Boolean
}
}
```
If `cancelable` or `bubbles` are undefined, it's because there is no entry for them on MDN.
## Duplicates
Some events have duplicate interfaces. To make this package easier to use, duplicates have been removed. You can see a list of events with duplicate interfaces, and the interface that's exported in this project.
| name | event interfaces | interface in `dom-event-types` |
| ------- | -------------------------------------------------------- | ------------------------------ |
| abort | Event, ProgressEvent, UIEvent | Event |
| end | Event, SpeechSynthesisEvent | Event |
| error | ProgressEvent, Event, SpeechSynthesisErrorEvent, UIEvent | Event |
| load | UIEvent, ProgressEvent | UIEvent |
| message | ServiceWorkerMessageEvent, MessageEvent | MessageEvent |
| error | ProgressEvent, Event, SpeechSynthesisErrorEvent, UIEvent | Event |