import type http from 'http' ; import { Socket } from '../net/socket' ; import { Readable } from '../stream/readable' ; import { rawHeaders } from '../../_internal/utils' ; export class IncomingMessage extends Readable implements http . IncomingMessage { public aborted : boolean = false ; public httpVersion : string = '1.1' ; public httpVersionMajor : number = 1 ; public httpVersionMinor : number = 1 ; public complete : boolean = true ; public connection : Socket ; public socket : Socket ; public headers : http . IncomingHttpHeaders = { } ; public trailers = { } ; public method : string = 'GET' ; public url : string = '/' ; public statusCode : number = 200 ; public statusMessage : string = '' ; readable : boolean = false ; constructor ( socket ? ) { super ( ) ; this . socket = this . connection = socket || new Socket ( ) ; } get rawHeaders ( ) { return rawHeaders ( this . headers ) ; } get rawTrailers ( ) { return [ ] ; } setTimeout ( _msecs , _callback ? ) { return this ; } }