From 7f433055b3e79d8df6c9b6e127504c3dfa7a8579 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 13 Nov 2026 04:19:04 -0800 Subject: [PATCH] Type the `verifyClient` callback in the `ws` library definition Summary: The `ws` v7 library definition declared `verifyClient` as `() => unknown`, so callers that read the connection info (such as `origin`) failed to type-check. Type its first argument as the info object `ws` passes (`origin`, `secure` and `req`), matching the React Native copy of this definition. Changelog: [Internal] Differential Revision: D131765444 --- flow-typed/npm/ws_v7.x.x.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/flow-typed/npm/ws_v7.x.x.js b/flow-typed/npm/ws_v7.x.x.js index 32ef350263..f36937d80b 100644 --- a/flow-typed/npm/ws_v7.x.x.js +++ b/flow-typed/npm/ws_v7.x.x.js @@ -39,7 +39,13 @@ declare class ws$WebSocketServer extends events$EventEmitter { perMessageDeflate?: boolean | ws$PerMessageDeflateOptions, port?: number, server?: http$Server | https$Server, - verifyClient?: () => unknown, + verifyClient?: ( + info: Readonly<{ + origin: string, + secure: boolean, + req: http$IncomingMessage<>, + }>, + ) => unknown, }, callback?: () => unknown, ): this;