index.d.ts 799 B

1234567891011121314151617181920212223242526272829
  1. /// <reference types="node"/>
  2. import {IncomingMessage} from 'http';
  3. declare const decompressResponse: {
  4. /**
  5. Decompress a HTTP response if needed.
  6. @param response - The HTTP incoming stream with compressed data.
  7. @returns The decompressed HTTP response stream.
  8. @example
  9. ```
  10. import {http} from 'http';
  11. import decompressResponse = require('decompress-response');
  12. http.get('https://sindresorhus.com', response => {
  13. response = decompressResponse(response);
  14. });
  15. ```
  16. */
  17. (response: IncomingMessage): IncomingMessage;
  18. // TODO: remove this in the next major version, refactor the whole definition to:
  19. // declare function decompressResponse(response: IncomingMessage): IncomingMessage;
  20. // export = decompressResponse;
  21. default: typeof decompressResponse;
  22. };
  23. export = decompressResponse;