Skip to content

Commit ce2173b

Browse files
committed
Add generic type parameter to json() #3
1 parent 36d5e9a commit ce2173b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

types/fetch.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ declare global {
136136
formData(): Promise<FormData>;
137137

138138
/** Reads the body as JSON. */
139-
json(): Promise<unknown>;
139+
json<T = unknown>(): Promise<T>;
140140

141141
/** Reads the body as text. */
142142
text(): Promise<string>;
@@ -227,7 +227,7 @@ declare global {
227227
formData(): Promise<FormData>;
228228

229229
/** Reads the body as JSON. */
230-
json(): Promise<unknown>;
230+
json<T = unknown>(): Promise<T>;
231231

232232
/** Reads the body as text. */
233233
text(): Promise<string>;

0 commit comments

Comments
 (0)