index.d.ts 525 B

1234567891011121314151617
  1. import {IncomingMessage} from 'http';
  2. /**
  3. Mimic a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
  4. Makes `toStream` include the properties from `fromStream`.
  5. @param fromStream - The stream to copy the properties from.
  6. @param toStream - The stream to copy the properties to.
  7. @return The same object as `toStream`.
  8. */
  9. declare function mimicResponse<T extends NodeJS.ReadableStream>(
  10. fromStream: IncomingMessage,
  11. toStream: T,
  12. ): IncomingMessage & T;
  13. export = mimicResponse;