diff --git a/baselines/audioworklet.generated.d.ts b/baselines/audioworklet.generated.d.ts index 3f12afc9c..43a65d353 100644 --- a/baselines/audioworklet.generated.d.ts +++ b/baselines/audioworklet.generated.d.ts @@ -862,6 +862,9 @@ interface ReadableStreamGenericReader { cancel(reason?: any): Promise; } +interface ResponseConstructor { +} + /** * A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. * diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index ab9f9a750..ad5e94b4f 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -20043,20 +20043,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Provides access to the properties of element, as well as methods to manipulate them. @@ -27183,6 +27184,8 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window) */ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + readonly Response: ResponseConstructor; /** * @deprecated This is a legacy alias of `navigator`. * @@ -28820,6 +28823,8 @@ declare var Image: { declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ +declare var Response: ResponseConstructor; /** * @deprecated This is a legacy alias of `navigator`. * diff --git a/baselines/serviceworker.generated.d.ts b/baselines/serviceworker.generated.d.ts index d03491c69..5361aa3c3 100644 --- a/baselines/serviceworker.generated.d.ts +++ b/baselines/serviceworker.generated.d.ts @@ -4896,20 +4896,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. diff --git a/baselines/sharedworker.generated.d.ts b/baselines/sharedworker.generated.d.ts index 80a7896f1..06eefe021 100644 --- a/baselines/sharedworker.generated.d.ts +++ b/baselines/sharedworker.generated.d.ts @@ -4658,20 +4658,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. diff --git a/baselines/ts5.5/audioworklet.generated.d.ts b/baselines/ts5.5/audioworklet.generated.d.ts index 3f12afc9c..43a65d353 100644 --- a/baselines/ts5.5/audioworklet.generated.d.ts +++ b/baselines/ts5.5/audioworklet.generated.d.ts @@ -862,6 +862,9 @@ interface ReadableStreamGenericReader { cancel(reason?: any): Promise; } +interface ResponseConstructor { +} + /** * A decoder for a specific method, that is a specific character encoding, like utf-8, iso-8859-2, koi8, cp1261, gbk, etc. A decoder takes a stream of bytes as input and emits a stream of code points. For a more scalable, non-native library, see StringView – a C-like representation of strings based on typed arrays. * diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index 2960c5748..c2793050d 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -20023,20 +20023,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Provides access to the properties of element, as well as methods to manipulate them. @@ -27161,6 +27162,8 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window) */ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage { + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + readonly Response: ResponseConstructor; /** * @deprecated This is a legacy alias of `navigator`. * @@ -28798,6 +28801,8 @@ declare var Image: { declare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; +/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ +declare var Response: ResponseConstructor; /** * @deprecated This is a legacy alias of `navigator`. * diff --git a/baselines/ts5.5/serviceworker.generated.d.ts b/baselines/ts5.5/serviceworker.generated.d.ts index d03491c69..5361aa3c3 100644 --- a/baselines/ts5.5/serviceworker.generated.d.ts +++ b/baselines/ts5.5/serviceworker.generated.d.ts @@ -4896,20 +4896,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. diff --git a/baselines/ts5.5/sharedworker.generated.d.ts b/baselines/ts5.5/sharedworker.generated.d.ts index 80a7896f1..06eefe021 100644 --- a/baselines/ts5.5/sharedworker.generated.d.ts +++ b/baselines/ts5.5/sharedworker.generated.d.ts @@ -4658,20 +4658,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. diff --git a/baselines/ts5.5/webworker.generated.d.ts b/baselines/ts5.5/webworker.generated.d.ts index 8b2139eb6..bdbe97133 100644 --- a/baselines/ts5.5/webworker.generated.d.ts +++ b/baselines/ts5.5/webworker.generated.d.ts @@ -5595,20 +5595,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 8b2139eb6..bdbe97133 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -5595,20 +5595,21 @@ interface Response extends Body { readonly type: ResponseType; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/url) */ readonly url: string; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ - clone(): Response; } -declare var Response: { +interface ResponseConstructor { prototype: Response; - new(body?: BodyInit | null, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/clone) */ + clone(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/error_static) */ error(): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/json_static) */ json(data: any, init?: ResponseInit): Response; + /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/Response) */ + new(body?: BodyInit | null, init?: ResponseInit): Response; /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Response/redirect_static) */ redirect(url: string | URL, status?: number): Response; -}; +} /** * Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. diff --git a/inputfiles/addedTypes.jsonc b/inputfiles/addedTypes.jsonc index 3c2041999..3d9027a55 100644 --- a/inputfiles/addedTypes.jsonc +++ b/inputfiles/addedTypes.jsonc @@ -454,6 +454,227 @@ }, "interfaces": { "interface": { + "Response": { + "name": "Response", + "noInterfaceObject": true, + + "properties": { + "property": { + "type": { + "name": "type", + "type": "ResponseType", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/type" + }, + "url": { + "name": "url", + "type": "USVString", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/url" + }, + "redirected": { + "name": "redirected", + "type": "boolean", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/redirected" + }, + "status": { + "name": "status", + "type": "unsigned short", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/status" + }, + "ok": { + "name": "ok", + "type": "boolean", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/ok" + }, + "statusText": { + "name": "statusText", + "type": "ByteString", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/statusText" + }, + "headers": { + "name": "headers", + "type": "Headers", + "readonly": true, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/headers" + } + }, + "namesakes": {} + }, + "constructor": { + "signature": [ + { + "type": "Response", + "param": [ + { + "name": "body", + "type": "BodyInit", + "nullable": true, + "optional": true, + "variadic": false + }, + { + "name": "init", + "type": "ResponseInit", + "nullable": false, + "optional": true, + "variadic": false + } + ] + } + ] + }, + "exposed": "Window Worker", + "legacyWindowAlias": [], + "secureContext": false, + "transferable": false, + "implements": ["Body"], + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response", + "comment": "This Fetch API interface represents the response to a request." + }, + "ResponseConstructor": { + "name": "ResponseConstructor", + "noInterfaceObject": true, + + "properties": { + "property": { + "prototype": { + "name": "prototype", + "type": "Response", + "exposed": "Window Worker" + } + } + }, + + "methods": { + "method": { + "new": { + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/Response", + "name": "new", + "exposed": "Window Worker", + "signature": [ + { + "type": "Response", + "param": [ + { + "name": "body", + "type": "BodyInit", + "nullable": true, + "optional": true, + "variadic": false + }, + { + "name": "init", + "type": "ResponseInit", + "nullable": false, + "optional": true, + "variadic": false + } + ] + } + ] + }, + "error": { + "name": "error", + "signature": [ + { + "type": "Response", + "nullable": false, + "param": [] + } + ], + "getter": false, + "stringifier": false, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/error_static" + }, + "redirect": { + "name": "redirect", + "signature": [ + { + "type": "Response", + "nullable": false, + "param": [ + { + "name": "url", + "type": "USVString", + "nullable": false, + "optional": false, + "variadic": false + }, + { + "name": "status", + "type": "unsigned short", + "nullable": false, + "optional": true, + "variadic": false + } + ] + } + ], + "getter": false, + "stringifier": false, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/redirect_static" + }, + "json": { + "name": "json", + "signature": [ + { + "type": "Response", + "nullable": false, + "param": [ + { + "name": "data", + "type": "any", + "nullable": false, + "optional": false, + "variadic": false + }, + { + "name": "init", + "type": "ResponseInit", + "nullable": false, + "optional": true, + "variadic": false + } + ] + } + ], + "getter": false, + "stringifier": false, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/json_static" + }, + "clone": { + "name": "clone", + "signature": [ + { + "type": "Response", + "nullable": false, + "param": [] + } + ], + "getter": false, + "static": false, + "stringifier": false, + "exposed": "Window Worker", + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/clone" + } + } + } + }, // ImportMeta is not a true DOM interface, but we are forced to declare it as one in order to emit method definitions. // We cannot define methods as dictionary properties with function types, // as this would cause conflicts with ImportMeta method overrides in places like @types/node. @@ -604,6 +825,19 @@ "overrideIndexSignatures": [ "[index: number]: Window" ], + "properties": { + "property": { + "Response": { + "name": "Response", + "type": "ResponseConstructor", + "nullable": false, + "readonly": true, + "exposed": "Window", + "secureContext": false, + "mdnUrl": "https://developer.mozilla.org/docs/Web/API/Response/Response" + } + } + }, "events": { "event": [ { diff --git a/inputfiles/removedTypes.jsonc b/inputfiles/removedTypes.jsonc index 2cceaf507..b0a66a954 100644 --- a/inputfiles/removedTypes.jsonc +++ b/inputfiles/removedTypes.jsonc @@ -109,6 +109,7 @@ }, "interfaces": { "interface": { + "Response": null, "Clipboard": { "methods": { "method": {