Skip to content

Commit b4f65b9

Browse files
authored
[node] Change http AgentOptions to extend partial with undefined (DefinitelyTyped#73865)
1 parent 8e81354 commit b4f65b9

File tree

8 files changed

+12
-4
lines changed

8 files changed

+12
-4
lines changed

types/node/globals.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ declare namespace NodeJS {
143143
readonly [key: string]: T | undefined;
144144
}
145145

146+
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
147+
146148
interface GCFunction {
147149
(minor?: boolean): void;
148150
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;

types/node/http.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ declare module "http" {
14521452
https_proxy?: string | undefined;
14531453
no_proxy?: string | undefined;
14541454
}
1455-
interface AgentOptions extends Partial<TcpSocketConnectOpts> {
1455+
interface AgentOptions extends NodeJS.PartialOptions<TcpSocketConnectOpts> {
14561456
/**
14571457
* Keep sockets around in a pool to be used by other requests in the future. Default = false
14581458
*/

types/node/v18/globals.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ declare namespace NodeJS {
143143
readonly [key: string]: T | undefined;
144144
}
145145

146+
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
147+
146148
interface GCFunction {
147149
(minor?: boolean): void;
148150
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;

types/node/v18/http.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ declare module "http" {
13981398
*/
13991399
destroy(error?: Error): this;
14001400
}
1401-
interface AgentOptions extends Partial<TcpSocketConnectOpts> {
1401+
interface AgentOptions extends NodeJS.PartialOptions<TcpSocketConnectOpts> {
14021402
/**
14031403
* Keep sockets around in a pool to be used by other requests in the future. Default = false
14041404
*/

types/node/v20/globals.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ declare namespace NodeJS {
143143
readonly [key: string]: T | undefined;
144144
}
145145

146+
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
147+
146148
interface GCFunction {
147149
(minor?: boolean): void;
148150
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;

types/node/v20/http.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ declare module "http" {
14171417
*/
14181418
destroy(error?: Error): this;
14191419
}
1420-
interface AgentOptions extends Partial<TcpSocketConnectOpts> {
1420+
interface AgentOptions extends NodeJS.PartialOptions<TcpSocketConnectOpts> {
14211421
/**
14221422
* Keep sockets around in a pool to be used by other requests in the future. Default = false
14231423
*/

types/node/v22/globals.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ declare namespace NodeJS {
143143
readonly [key: string]: T | undefined;
144144
}
145145

146+
type PartialOptions<T> = { [K in keyof T]?: T[K] | undefined };
147+
146148
interface GCFunction {
147149
(minor?: boolean): void;
148150
(options: NodeJS.GCOptions & { execution: "async" }): Promise<void>;

types/node/v22/http.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ declare module "http" {
14191419
*/
14201420
destroy(error?: Error): this;
14211421
}
1422-
interface AgentOptions extends Partial<TcpSocketConnectOpts> {
1422+
interface AgentOptions extends NodeJS.PartialOptions<TcpSocketConnectOpts> {
14231423
/**
14241424
* Keep sockets around in a pool to be used by other requests in the future. Default = false
14251425
*/

0 commit comments

Comments
 (0)