File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 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 {
128128
129129 /**
130130 * @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 .
132132 * @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.
134134 */
135135 static json ( data , responseInit = { } ) {
136136 let headers = new Headers ( responseInit . headers ) ;
@@ -159,3 +159,9 @@ Object.defineProperties(Response.prototype, {
159159 clone : { enumerable : true }
160160} ) ;
161161
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