proxy-agent.d.ts 836 B

123456789101112131415161718192021222324252627282930
  1. import Agent from './agent'
  2. import buildConnector from './connector';
  3. import Client from './client'
  4. import Dispatcher from './dispatcher'
  5. import { IncomingHttpHeaders } from './header'
  6. import Pool from './pool'
  7. export default ProxyAgent
  8. declare class ProxyAgent extends Dispatcher {
  9. constructor(options: ProxyAgent.Options | string)
  10. dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
  11. close(): Promise<void>;
  12. }
  13. declare namespace ProxyAgent {
  14. export interface Options extends Agent.Options {
  15. uri: string;
  16. /**
  17. * @deprecated use opts.token
  18. */
  19. auth?: string;
  20. token?: string;
  21. headers?: IncomingHttpHeaders;
  22. requestTls?: buildConnector.BuildOptions;
  23. proxyTls?: buildConnector.BuildOptions;
  24. clientFactory?(origin: URL, opts: object): Dispatcher;
  25. }
  26. }