http.d.ts 810 B

12345678910111213141516
  1. /// <reference types="node" />
  2. import { CreateRequestOptions, HttpMethod } from '../../definitions';
  3. export declare type SuperAgentRequest = import('superagent').SuperAgentRequest;
  4. export declare const PROXY_ENVIRONMENT_VARIABLES: readonly string[];
  5. export declare function createRequest(method: HttpMethod, url: string, { userAgent, proxy, ssl }: CreateRequestOptions): Promise<{
  6. req: SuperAgentRequest;
  7. }>;
  8. /**
  9. * Initiate a request, downloading the contents to a writable stream.
  10. *
  11. * @param req The request to download to the writable stream.
  12. * @param ws Must be a dedicated writable stream that calls the 'close' event.
  13. */
  14. export declare function download(req: SuperAgentRequest, ws: NodeJS.WritableStream, { progress }: {
  15. progress?: (loaded: number, total: number) => void;
  16. }): Promise<void>;