Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
Fixup FetchEvent override and definition (#235)
Browse files Browse the repository at this point in the history
* Fixup FetchEvent override and definition

FetchEvent now extends from ExtendableEvent.

* add a changeset

Co-authored-by: Sunil Pai <spai@cloudflare.com>
  • Loading branch information
jasnell and threepointone authored May 10, 2022
1 parent 97499a2 commit a919734
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-hounds-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/workers-types": patch
---

FetchEvent now extends from ExtendableEvent.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ declare class ExtendableEvent extends Event {
waitUntil(promise: Promise<any>): void;
}

declare abstract class FetchEvent extends Event {
declare abstract class FetchEvent extends ExtendableEvent {
readonly request: Request;
respondWith(promise: Response | Promise<Response>): void;
passThroughOnException(): void;
Expand Down
2 changes: 1 addition & 1 deletion overrides/http.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ declare type URLSearchParamsInit =
| Record<string, string>
| [key: string, value: string][];

declare class FetchEvent extends Event {
declare class FetchEvent extends ExtendableEvent {
respondWith(promise: Response | Promise<Response>): void;
}

Expand Down
2 changes: 1 addition & 1 deletion src/workers.json
Original file line number Diff line number Diff line change
Expand Up @@ -4355,7 +4355,7 @@
],
"extends": [
{
"name": "Event"
"name": "ExtendableEvent"
}
],
"kind": "class"
Expand Down

0 comments on commit a919734

Please sign in to comment.