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) • 595 B
text/typescript
import Event from '../Event.js';
import IProgressEventInit from './IProgressEventInit.js';
/**
*
*/
export default class ProgressEvent extends Event {
public readonly lengthComputable: boolean;
public readonly loaded: number;
public readonly total: number;
/**
* Constructor.
*
* @param type Event type.
* @param [eventInit] Event init.
*/
constructor(type: string, eventInit: IProgressEventInit | null = null) {
super(type);
this.lengthComputable = eventInit?.lengthComputable ?? false;
this.loaded = eventInit?.loaded ?? 0;
this.total = eventInit?.total ?? 0;
}
}