-
Notifications
You must be signed in to change notification settings - Fork 111
No type definitions for objectMode? #168
Copy link
Copy link
Open
Description
Somehow, the objectMode option has disappeared in the TypeScript definition. I wonder, it is still supported?
Here is my code:
const stream = websocket(ws, {
// Important, send each chunk on its own, see
// https://github.com/maxogden/websocket-stream/issues/117#issuecomment-298826011
objectMode: true,
});It produces this error
No overload matches this call.
Overload 1 of 2, '(target: string | WebSocket, options?: ClientOptions | undefined): WebSocketDuplex', gave the following error.
Object literal may only specify known properties, and 'objectMode' does not exist in type 'ClientOptions'.
Overload 2 of 2, '(target: string | WebSocket, protocols?: string | string[] | undefined, options?: ClientOptions | undefined): WebSocketDuplex', gave the following error.
Object literal may only specify known properties, and 'objectMode' does not exist in type 'string[]'.
I'm using latest websocket-stream version 5.5.2
There is one interesting I've found out in the type declarations:
declare function WebSocketStream(target: string | WebSocket, options?: WebSocket.ClientOptions): WebSocketStream.WebSocketDuplex;WebSocket.ClientOptions itself stems from @types/ws where the ClientOptions are being extended by SecureContextOptions which comes from @types/node. To me, it seems there are some version mismatches, perhaps?
For now, I will @tsignore it, but am not comfortable about it.
Advice, discussions welcome. Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels