happy-dom
Version:
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
26 lines (22 loc) • 573 B
text/typescript
import Event from '../Event.js';
import type ICloseEventInit from './ICloseEventInit.js';
/**
*
*/
export default class CloseEvent extends Event {
public readonly code: number;
public readonly reason: string;
public readonly wasClean: boolean;
/**
* Constructor.
*
* @param type Event type.
* @param [eventInit] Event init.
*/
constructor(type: string, eventInit: ICloseEventInit | null = null) {
super(type, eventInit);
this.code = eventInit?.code ?? 0;
this.reason = eventInit?.reason ?? '';
this.wasClean = eventInit?.wasClean ?? false;
}
}