source: trip-planner-front/node_modules/agentkeepalive/index.d.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.7 KB
Line 
1import * as http from 'http';
2import * as https from 'https';
3
4interface PlainObject {
5 [key: string]: any;
6}
7
8declare class HttpAgent extends http.Agent {
9 constructor(opts?: AgentKeepAlive.HttpOptions);
10 readonly statusChanged: boolean;
11 createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void;
12 getCurrentStatus(): AgentKeepAlive.AgentStatus;
13}
14
15interface Constants {
16 CURRENT_ID: Symbol;
17 CREATE_ID: Symbol;
18 INIT_SOCKET: Symbol;
19 CREATE_HTTPS_CONNECTION: Symbol;
20 SOCKET_CREATED_TIME: Symbol;
21 SOCKET_NAME: Symbol;
22 SOCKET_REQUEST_COUNT: Symbol;
23 SOCKET_REQUEST_FINISHED_COUNT: Symbol;
24}
25
26declare class AgentKeepAlive extends HttpAgent {}
27
28declare namespace AgentKeepAlive {
29 export interface AgentStatus {
30 createSocketCount: number;
31 createSocketErrorCount: number;
32 closeSocketCount: number;
33 errorSocketCount: number;
34 timeoutSocketCount: number;
35 requestCount: number;
36 freeSockets: PlainObject;
37 sockets: PlainObject;
38 requests: PlainObject;
39 }
40
41 interface CommonHttpOption {
42 keepAlive?: boolean;
43 freeSocketTimeout?: number;
44 freeSocketKeepAliveTimeout?: number;
45 timeout?: number;
46 socketActiveTTL?: number;
47 }
48
49 export interface HttpOptions extends http.AgentOptions, CommonHttpOption { }
50 export interface HttpsOptions extends https.AgentOptions, CommonHttpOption { }
51
52 export class HttpsAgent extends https.Agent {
53 constructor(opts?: HttpsOptions);
54 readonly statusChanged: boolean;
55 createSocket(req: http.IncomingMessage, options: http.RequestOptions, cb: Function): void;
56 getCurrentStatus(): AgentStatus;
57 }
58
59 export const constants: Constants;
60}
61
62export = AgentKeepAlive;
Note: See TracBrowser for help on using the repository browser.