UNPKG

493 BJavaScriptView Raw
1const Event = require('./Event');
2
3// interface CustomEvent // https://dom.spec.whatwg.org/#customevent
4module.exports = class CustomEvent extends Event {
5 constructor(type, eventInitDict = {
6 bubbles: false,
7 cancelable: false,
8 composed: false,
9 detail: null
10 }) {
11 super(type, eventInitDict);
12 this.detail = eventInitDict.detail;
13 }
14
15 initCustomEvent(type, bubbles, cancelable, detail) {
16 this.initEvent(type, bubbles, cancelable);
17 this.detail = detail;
18 }
19};