Skip to content

Commit

Permalink
Update Body json() method to allow generic types.
Browse files Browse the repository at this point in the history
  • Loading branch information
incogiscool committed Apr 29, 2024
1 parent cfd6476 commit 79861bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3165,7 +3165,7 @@ interface Body {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/formData) */
formData(): Promise<FormData>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/json) */
json(): Promise<any>;
json<T = any>(): Promise<T>;
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/text) */
text(): Promise<string>;
}
Expand Down
17 changes: 17 additions & 0 deletions inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,23 @@
"overrideType": "ReadableStream<Uint8Array>"
}
}
},
"methods": {
"method": {
"json": {
"signature": {
"0": {
"typeParameters": [
{
"name": "T",
"default": "any"
}
],
"overrideType": "Promise<T>"
}
}
}
}
}
},
"WindowOrWorkerGlobalScope": {
Expand Down

0 comments on commit 79861bf

Please sign in to comment.