Skip to content

Commit 9f41162

Browse files
committed
fix: resolve issues with ts types
1 parent 199e74a commit 9f41162

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dummy/xhr.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ export default class dummyXMLHttpRequest {
8787
}
8888

8989
if (typeof xhr.onload === 'function') {
90-
xhr.onload(this.event('load'));
90+
xhr.onload(this.event('load') as ProgressEvent<EventTarget>);
9191
} else if (isEventReady) {
9292
xhr.dispatchEvent(new Event('load'));
9393
}
9494
if (typeof xhr.onloadend === 'function') {
95-
xhr.onloadend(this.event('loadend'));
95+
xhr.onloadend(this.event('loadend') as ProgressEvent<EventTarget>);
9696
} else if (isEventReady) {
9797
xhr.dispatchEvent(new Event('loadend'));
9898
}
9999
}
100100

101-
private event(type: string) {
101+
private event(type: string): Event {
102102
return {
103103
type,
104104
target: this,
@@ -126,7 +126,7 @@ export default class dummyXMLHttpRequest {
126126
lengthComputable: false,
127127
loaded: 1,
128128
total: 1
129-
};
129+
} as unknown as Event;
130130
}
131131

132132
getAllResponseHeaders() {

0 commit comments

Comments
 (0)