@@ -59,6 +59,11 @@ import {
5959import { isUint8Array , isArrayBufferView } from 'node-internal:internal_types' ;
6060import { Duplex } from 'node-internal:streams_duplex' ;
6161import { Buffer } from 'node-internal:internal_buffer' ;
62+ import {
63+ kDestroyed ,
64+ kIsReadable ,
65+ kIsWritable ,
66+ } from 'node-internal:streams_util' ;
6267import type {
6368 IpcSocketConnectOpts ,
6469 SocketConnectOpts ,
@@ -132,13 +137,12 @@ export type SocketOptions = {
132137 handle ?: Socket [ '_handle' ] ;
133138 noDelay ?: boolean ;
134139 keepAlive ?: boolean ;
135- allowHalfOpen ?: boolean | undefined ;
140+ allowHalfOpen ?: boolean ;
136141 emitClose ?: boolean ;
137- signal ?: AbortSignal | undefined ;
142+ signal ?: AbortSignal ;
138143 onread ?:
139144 | ( { callback ?: ( ) => Uint8Array ; buffer ?: Uint8Array } & OnReadOpts )
140- | null
141- | undefined ;
145+ | null ;
142146} ;
143147
144148export function Server ( ) : void {
@@ -211,7 +215,14 @@ export declare class Socket extends _Socket {
211215 _read ( n : number ) : void ;
212216 _reset ( ) : void ;
213217 _getpeername ( ) : Record < string , unknown > ;
214- _writableState : null | unknown [ ] ;
218+ _readableState : undefined ;
219+ _closed : boolean ;
220+ writableErrored : boolean ;
221+ readableErrored : boolean ;
222+ [ kIsReadable ] : boolean ;
223+ [ kIsWritable ] : boolean ;
224+ [ kDestroyed ] : boolean ;
225+ _writableState : undefined ;
215226 _bytesDispatched : number ;
216227 _pendingData : SocketWriteData | null ;
217228 _pendingEncoding : string ;
@@ -331,7 +342,6 @@ export function Socket(this: Socket, options?: SocketOptions): Socket {
331342 // Call Duplex constructor before setting up the abort signal
332343 // This ensures the stream methods are properly set up before
333344 // any abort handling that might call destroy()
334- // @ts -expect-error TS2379 Type incompatibility with exactOptionalPropertyTypes
335345 Duplex . call ( this , options ) ;
336346
337347 if ( options . handle ) {
0 commit comments