You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 1022B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Type definitions for agent-base 4.2.1
  2. // Project: https://github.com/TooTallNate/node-agent-base
  3. // Definitions by: Christopher Quadflieg <https://github.com/Shinigami92>
  4. /// <reference types="node" />
  5. import { EventEmitter } from 'events';
  6. declare namespace Agent {
  7. export type AgentCallback = (
  8. req?: any,
  9. opts?: {
  10. secureEndpoint: boolean;
  11. }
  12. ) => void;
  13. export interface AgentOptions {
  14. timeout?: number;
  15. host?: string;
  16. port?: number;
  17. [key: string]: any;
  18. }
  19. export interface Agent extends EventEmitter {
  20. _promisifiedCallback: boolean;
  21. timeout: number | null;
  22. options?: AgentOptions;
  23. callback: AgentCallback;
  24. addRequest: (req?: any, opts?: any) => void;
  25. freeSocket: (socket: any, opts: any) => void;
  26. }
  27. }
  28. /**
  29. * Base `http.Agent` implementation.
  30. * No pooling/keep-alive is implemented by default.
  31. */
  32. declare function Agent(opts?: Agent.AgentOptions): Agent.Agent;
  33. declare function Agent(
  34. callback: Agent.AgentCallback,
  35. opts?: Agent.AgentOptions
  36. ): Agent.Agent;
  37. export = Agent;