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