@@ -750,62 +750,32 @@ declare module "http" {
750
750
timeout : number ;
751
751
}
752
752
753
- export class ServerResponse extends stream . Writable {
753
+ export class OutgoingMessage extends stream . Writable {
754
754
finished : boolean ;
755
+ sendDate : boolean ;
755
756
headersSent : boolean ;
757
+
758
+ setTimeout ( msecs : number , callback ?: ( ) => void ) : this;
759
+ setHeader ( name : string , value : string ) : void ;
760
+ getHeader ( name : string ) : string ;
761
+ removeHeader ( name : string ) : void ;
762
+ addTrailers ( headers : OutgoingHeaders ) : void ;
763
+ setTimeout ( msecs : number , callback ?: ( ) => void ) : this;
764
+ }
765
+
766
+ export class ServerResponse extends OutgoingMessage {
756
767
statusCode : number ;
757
768
statusMessage : string ;
758
- sendDate : boolean ;
759
-
760
- // Extended base methods
761
- write ( buffer : Buffer ) : boolean ;
762
- write ( buffer : Buffer , cb ?: Function ) : boolean ;
763
- write ( str : string , cb ?: Function ) : boolean ;
764
- write ( str : string , encoding ?: string , cb ?: Function ) : boolean ;
765
- write ( str : string , encoding ?: string , fd ?: string ) : boolean ;
766
769
767
770
writeContinue ( ) : void ;
768
771
writeHead ( statusCode : number , statusText ?: string , headers ?: OutgoingHeaders ) : void ;
769
772
writeHead ( statusCode : number , headers ?: OutgoingHeaders ) : void ;
770
- setHeader ( name : string , value : string | string [ ] ) : void ;
771
- setTimeout ( msecs : number , callback : ( ) => void ) : this;
772
- getHeader ( name : string ) : string ;
773
- removeHeader ( name : string ) : void ;
774
- write ( chunk : any , encoding ?: string ) : any ;
775
- addTrailers ( headers : OutgoingHeaders ) : void ;
776
-
777
- // Extended base methods
778
- end ( ) : void ;
779
- end ( buffer : Buffer , cb ?: Function ) : void ;
780
- end ( str : string , cb ?: Function ) : void ;
781
- end ( str : string , encoding ?: string , cb ?: Function ) : void ;
782
773
}
783
774
784
- export class ClientRequest extends stream . Writable {
785
- // Extended base methods
786
- write ( buffer : Buffer ) : boolean ;
787
- write ( buffer : Buffer , cb ?: Function ) : boolean ;
788
- write ( str : string , cb ?: Function ) : boolean ;
789
- write ( str : string , encoding ?: string , cb ?: Function ) : boolean ;
790
- write ( str : string , encoding ?: string , fd ?: string ) : boolean ;
791
-
792
- write ( chunk : any , encoding ?: string ) : void ;
775
+ export class ClientRequest extends OutgoingMessage {
793
776
abort ( ) : void ;
794
- setTimeout ( timeout : number , callback ?: Function ) : void ;
795
777
setNoDelay ( noDelay ?: boolean ) : void ;
796
778
setSocketKeepAlive ( enable ?: boolean , initialDelay ?: number ) : void ;
797
-
798
- setHeader ( name : string , value : string | string [ ] ) : void ;
799
- getHeader ( name : string ) : string ;
800
- removeHeader ( name : string ) : void ;
801
- addTrailers ( headers : OutgoingHeaders ) : void ;
802
-
803
- // Extended base methods
804
- end ( ) : void ;
805
- end ( buffer : Buffer , cb ?: Function ) : void ;
806
- end ( str : string , cb ?: Function ) : void ;
807
- end ( str : string , encoding ?: string , cb ?: Function ) : void ;
808
- end ( data ?: any , encoding ?: string ) : void ;
809
779
}
810
780
811
781
export class IncomingMessage extends stream . Readable {
@@ -816,7 +786,7 @@ declare module "http" {
816
786
rawHeaders : string [ ] ;
817
787
trailers : IncomingHeaders ;
818
788
rawTrailers : string [ ] ;
819
- setTimeout ( msecs : number , callback : Function ) : NodeJS . Timer ;
789
+ setTimeout ( msecs : number , callback : ( ) => void ) : this ;
820
790
destroy ( error ?: Error ) : void ;
821
791
/**
822
792
* Only valid for request obtained from http.Server.
0 commit comments