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>
5 /// <reference types="node" />
6 import { EventEmitter } from 'events';
8 declare namespace Agent {
9 export type AgentCallback = (
12 secureEndpoint: boolean;
16 export interface AgentOptions {
23 export interface Agent extends EventEmitter {
24 _promisifiedCallback: boolean;
25 timeout: number | null;
26 options?: AgentOptions;
27 callback: AgentCallback;
28 addRequest: (req?: any, opts?: any) => void;
29 freeSocket: (socket: any, opts: any) => void;
34 * Base `http.Agent` implementation.
35 * No pooling/keep-alive is implemented by default.
37 declare function Agent(opts?: Agent.AgentOptions): Agent.Agent;
38 declare function Agent(
39 callback: Agent.AgentCallback,
40 opts?: Agent.AgentOptions