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) • 606 B
text/typescript
import Event from '../Event.js';
import IHashChangeEventInit from './IHashChangeEventInit.js';
/**
* Hash change event.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/HashChangeEvent
*/
export default class HashChangeEvent extends Event {
public readonly newURL: string;
public readonly oldURL: string;
/**
* Constructor.
*
* @param type Event type.
* @param [eventInit] Event init.
*/
constructor(type: string, eventInit: IHashChangeEventInit | null = null) {
super(type, eventInit);
this.newURL = eventInit?.newURL ?? '';
this.oldURL = eventInit?.oldURL ?? '';
}
}