From 9f3b8336e9af234203ec81213239d5bee29f5ef9 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Thu, 19 Sep 2024 15:11:21 -0400 Subject: [PATCH] use correct types for webSocket (#2738) --- src/workerd/api/http.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/workerd/api/http.h b/src/workerd/api/http.h index 9b642320914..b099fff0d15 100644 --- a/src/workerd/api/http.h +++ b/src/workerd/api/http.h @@ -1041,6 +1041,7 @@ class Response final: public Body { JSG_STRUCT_TS_OVERRIDE(ResponseInit { headers?: HeadersInit; encodeBody?: "automatic" | "manual"; + webSocket?: WebSocket; }); }; @@ -1161,7 +1162,7 @@ class Response final: public Body { // JSG_READONLY_INSTANCE_PROPERTY(type, getType); } - JSG_TS_OVERRIDE({ constructor(body?: BodyInit | null, init?: ResponseInit); }); + JSG_TS_OVERRIDE({ constructor(body?: BodyInit | null, init?: ResponseInit, webSocket?: WebSocket); }); // Use `BodyInit` and `ResponseInit` type aliases in constructor instead of inlining }