Skip to content

Commit 51ba303

Browse files
authored
🤖 Merge PR DefinitelyTyped#72321 [ws] Update type of finishRequest to match documentation. by @yjwong
1 parent f992d39 commit 51ba303

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

‎types/ws/index.d.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ declare namespace WebSocket {
237237
* headers. If finishRequest is set, then it has the responsibility to call
238238
* request.end() once it is done setting request headers.
239239
*/
240-
type FinishRequestCallback = (request: IncomingMessage, websocket: WebSocket) => void;
240+
type FinishRequestCallback = (request: ClientRequest, websocket: WebSocket) => void;
241241

242242
interface ClientOptions extends SecureContextOptions {
243243
protocol?: string | undefined;

‎types/ws/index.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ declare namespace WebSocket {
240240
* headers. If finishRequest is set, then it has the responsibility to call
241241
* request.end() once it is done setting request headers.
242242
*/
243-
type FinishRequestCallback = (request: IncomingMessage, websocket: WebSocket) => void;
243+
type FinishRequestCallback = (request: ClientRequest, websocket: WebSocket) => void;
244244

245245
interface ClientOptions extends SecureContextOptions {
246246
protocol?: string | undefined;

‎types/ws/ws-tests.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ declare module "ws" {
525525
autoPong: false,
526526
createConnection: net.createConnection,
527527
finishRequest: (req, socket) => {
528-
// $ExpectType IncomingMessage
528+
// $ExpectType ClientRequest
529529
req;
530530

531531
// $ExpectType WebSocket

‎types/ws/ws-tests.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ declare module "ws" {
517517
autoPong: false,
518518
createConnection: net.createConnection,
519519
finishRequest: (req, socket) => {
520-
// $ExpectType IncomingMessage
520+
// $ExpectType ClientRequest
521521
req;
522522

523523
// $ExpectType WebSocket

0 commit comments

Comments
 (0)