http.d.ts 872 B

1234567891011121314151617181920212223242526272829
  1. /// <reference types="node" />
  2. /// <reference types="node" />
  3. /// <reference types="node" />
  4. /// <reference types="node" />
  5. import http_ from 'http';
  6. import https from 'https';
  7. import { Readable } from 'stream';
  8. import { GetUriProtocol } from '.';
  9. type HttpOrHttpsModule = typeof http_ | typeof https;
  10. export interface HttpReadableProps {
  11. date?: number;
  12. parsed?: URL;
  13. redirects?: HttpReadable[];
  14. }
  15. export interface HttpReadable extends Readable, HttpReadableProps {
  16. }
  17. export interface HttpIncomingMessage extends http_.IncomingMessage, HttpReadableProps {
  18. }
  19. export interface HttpOptions extends https.RequestOptions {
  20. cache?: HttpReadable;
  21. http?: HttpOrHttpsModule;
  22. redirects?: HttpReadable[];
  23. maxRedirects?: number;
  24. }
  25. /**
  26. * Returns a Readable stream from an "http:" URI.
  27. */
  28. export declare const http: GetUriProtocol<HttpOptions>;
  29. export {};