@@ -745,7 +745,8 @@ declare module "http" {
745
745
}
746
746
747
747
export class Server extends net . Server {
748
- setTimeout ( msecs : number , callback : Function ) : void ;
748
+ constructor ( req : IncomingMessage , res : ServerResponse ) ;
749
+ setTimeout ( msecs : number , callback ?: ( ) => void ) : void ;
749
750
maxHeadersCount : number ;
750
751
timeout : number ;
751
752
}
@@ -755,6 +756,7 @@ declare module "http" {
755
756
sendDate : boolean ;
756
757
headersSent : boolean ;
757
758
759
+ constructor ( ) ;
758
760
setTimeout ( msecs : number , callback ?: ( ) => void ) : this;
759
761
setHeader ( name : string , value : number | string | string [ ] ) : void ;
760
762
getHeader ( name : string ) : number | string | string [ ] | undefined ;
@@ -766,6 +768,7 @@ declare module "http" {
766
768
statusCode : number ;
767
769
statusMessage : string ;
768
770
771
+ constructor ( req : IncomingMessage ) ;
769
772
writeContinue ( cb ?: ( ) => void ) : void ;
770
773
writeHead ( statusCode : number , statusText ?: string , headers ?: OutgoingHeaders ) : void ;
771
774
writeHead ( statusCode : number , headers ?: OutgoingHeaders ) : void ;
@@ -774,6 +777,7 @@ declare module "http" {
774
777
}
775
778
776
779
export class ClientRequest extends OutgoingMessage {
780
+ constructor ( options : string | RequestOptions , cb ?: ( res : IncomingMessage ) => void ) ;
777
781
abort ( ) : void ;
778
782
setNoDelay ( noDelay ?: boolean ) : void ;
779
783
setSocketKeepAlive ( enable ?: boolean , initialDelay ?: number ) : void ;
@@ -787,8 +791,6 @@ declare module "http" {
787
791
rawHeaders : string [ ] ;
788
792
trailers : IncomingHeaders ;
789
793
rawTrailers : string [ ] ;
790
- setTimeout ( msecs : number , callback : ( ) => void ) : this;
791
- destroy ( error ?: Error ) : void ;
792
794
/**
793
795
* Only valid for request obtained from http.Server.
794
796
*/
@@ -806,6 +808,11 @@ declare module "http" {
806
808
*/
807
809
statusMessage ?: string ;
808
810
socket : net . Socket ;
811
+ connection : net . Socket ;
812
+
813
+ constructor ( socket : net . Socket ) ;
814
+ setTimeout ( msecs : number , callback : ( ) => void ) : this;
815
+ destroy ( error ?: Error ) : void ;
809
816
}
810
817
811
818
export interface AgentOptions {
@@ -1464,19 +1471,11 @@ declare module "net" {
1464
1471
export class Socket extends stream . Duplex {
1465
1472
constructor ( options ?: { fd ?: string ; type ?: string ; allowHalfOpen ?: boolean ; } ) ;
1466
1473
1467
- // Extended base methods
1468
- write ( buffer : Buffer ) : boolean ;
1469
- write ( buffer : Buffer , cb ?: Function ) : boolean ;
1470
- write ( str : string , cb ?: Function ) : boolean ;
1471
- write ( str : string , encoding ?: string , cb ?: Function ) : boolean ;
1472
- write ( str : string , encoding ?: string , fd ?: string ) : boolean ;
1473
-
1474
1474
connect ( port : number , host ?: string , connectionListener ?: Function ) : void ;
1475
1475
connect ( path : string , connectionListener ?: Function ) : void ;
1476
1476
bufferSize : number ;
1477
- write ( data : any , encoding ?: string , callback ?: Function ) : void ;
1478
- destroy ( ) : void ;
1479
- setTimeout ( timeout : number , callback ?: Function ) : void ;
1477
+ destroy ( exception ?: Error ) : void ;
1478
+ setTimeout ( timeout : number , callback ?: ( ) => void ) : void ;
1480
1479
setNoDelay ( noDelay ?: boolean ) : void ;
1481
1480
setKeepAlive ( enable ?: boolean , initialDelay ?: number ) : void ;
1482
1481
address ( ) : { port : number ; family : string ; address : string ; } ;
@@ -1490,13 +1489,6 @@ declare module "net" {
1490
1489
localPort : number ;
1491
1490
bytesRead : number ;
1492
1491
bytesWritten : number ;
1493
-
1494
- // Extended base methods
1495
- end ( ) : void ;
1496
- end ( buffer : Buffer , cb ?: Function ) : void ;
1497
- end ( str : string , cb ?: Function ) : void ;
1498
- end ( str : string , encoding ?: string , cb ?: Function ) : void ;
1499
- end ( data ?: any , encoding ?: string ) : void ;
1500
1492
}
1501
1493
1502
1494
export interface ListenOptions {
0 commit comments