Skip to content

Commit 3cc652f

Browse files
committed
Fix up https.Agent classes
1 parent fd484a5 commit 3cc652f

File tree

4 files changed

+22
-25
lines changed

4 files changed

+22
-25
lines changed

0.10/node.d.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -655,15 +655,13 @@ declare module "https" {
655655
rejectUnauthorized?: boolean;
656656
}
657657

658-
export interface Agent {
659-
maxSockets: number;
660-
sockets: any;
661-
requests: any;
658+
export interface AgentOptions extends http.AgentOptions {
659+
maxCachedSessions?: number;
662660
}
663661

664-
export var Agent: {
665-
new (options?: RequestOptions): Agent;
666-
};
662+
export class Agent extends http.Agent {
663+
constructor (options?: AgentOptions);
664+
}
667665

668666
export interface Server extends tls.Server { }
669667
export function createServer(options: ServerOptions, requestListener?: Function): Server;

0.12/node.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,14 @@ declare module "https" {
855855
rejectUnauthorized?: boolean;
856856
}
857857

858-
export interface Agent {
859-
maxSockets: number;
860-
sockets: any;
861-
requests: any;
858+
export interface AgentOptions extends http.AgentOptions {
859+
maxCachedSessions?: number;
862860
}
863-
export var Agent: {
864-
new (options?: RequestOptions): Agent;
865-
};
861+
862+
export class Agent extends http.Agent {
863+
constructor (options?: AgentOptions);
864+
}
865+
866866
export interface Server extends tls.Server { }
867867
export function createServer(options: ServerOptions, requestListener?: Function): Server;
868868
export function request(options: string | RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;

4.0/node.d.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,15 +1061,14 @@ declare module "https" {
10611061
secureProtocol?: string;
10621062
}
10631063

1064-
export interface Agent extends http.Agent { }
1065-
10661064
export interface AgentOptions extends http.AgentOptions {
10671065
maxCachedSessions?: number;
10681066
}
10691067

1070-
export var Agent: {
1071-
new (options?: AgentOptions): Agent;
1072-
};
1068+
export class Agent extends http.Agent {
1069+
constructor(options?: AgentOptions);
1070+
}
1071+
10731072
export interface Server extends tls.Server { }
10741073
export function createServer(options: ServerOptions, requestListener?: Function): Server;
10751074
export function request(options: string | RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;

6.0/node.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,16 +1087,16 @@ declare module "https" {
10871087
secureProtocol?: string;
10881088
}
10891089

1090-
export interface Agent extends http.Agent { }
1091-
10921090
export interface AgentOptions extends http.AgentOptions {
10931091
maxCachedSessions?: number;
10941092
}
10951093

1096-
export var Agent: {
1097-
new (options?: AgentOptions): Agent;
1098-
};
1099-
export interface Server extends tls.Server { }
1094+
export class Agent extends http.Agent {
1095+
constructor(options?: AgentOptions);
1096+
}
1097+
1098+
export class Server extends tls.Server {}
1099+
11001100
export function createServer(options: ServerOptions, requestListener?: Function): Server;
11011101
export function request(options: string | RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
11021102
export function get(options: string | RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;

0 commit comments

Comments
 (0)