File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -128,9 +128,9 @@ export default class Response extends Body {
128
128
129
129
/**
130
130
* @template {unknown} Data
131
- * @param {Data } data The URL that the new response is to originate from .
131
+ * @param {Data } data The data to be converted into a JSON string .
132
132
* @param {ResponseInit } [responseInit] An optional status code for the response (e.g., 302.)
133
- * @returns {Promise <Data> } A Response object.
133
+ * @returns {TypedResponse <Data> } A Response object.
134
134
*/
135
135
static json ( data , responseInit = { } ) {
136
136
let headers = new Headers ( responseInit . headers ) ;
@@ -159,3 +159,9 @@ Object.defineProperties(Response.prototype, {
159
159
clone : { enumerable : true }
160
160
} ) ;
161
161
162
+ /**
163
+ * @typedef {Omit<Response, "json"> & {
164
+ * json(): Promise<T>;
165
+ * }} TypedResponse
166
+ * @template T
167
+ */
You can’t perform that action at this time.
0 commit comments