index.d.ts 599 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, // eslint-disable-line @typescript-eslint/prefer-readonly-parameter-types
  11. toStream: T,
  12. ): T & IncomingMessage;
  13. export = mimicResponse;