@types/node 20.19.1 → 20.19.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node v20.19/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 16 Jun 2025 11:02:21 GMT
11
+ * Last updated: Tue, 01 Jul 2025 19:02:07 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node v20.19/http.d.ts CHANGED
@@ -44,7 +44,7 @@ declare module "http" {
44
44
  import { URL } from "node:url";
45
45
  import { LookupOptions } from "node:dns";
46
46
  import { EventEmitter } from "node:events";
47
- import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
47
+ import { LookupFunction, NetConnectOpts, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
48
48
  // incoming headers will never contain number
49
49
  interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
50
50
  accept?: string | undefined;
@@ -1449,6 +1449,21 @@ declare module "http" {
1449
1449
  */
1450
1450
  scheduling?: "fifo" | "lifo" | undefined;
1451
1451
  }
1452
+ interface AgentGetNameOptions {
1453
+ /**
1454
+ * A domain name or IP address of the server to issue the request to
1455
+ */
1456
+ host?: string | undefined;
1457
+ /**
1458
+ * Port of remote server
1459
+ */
1460
+ port?: number | undefined;
1461
+ /**
1462
+ * Local interface to bind for network connections when issuing the request
1463
+ */
1464
+ localAddress?: string | undefined;
1465
+ family?: 4 | 6 | undefined;
1466
+ }
1452
1467
  /**
1453
1468
  * An `Agent` is responsible for managing connection persistence
1454
1469
  * and reuse for HTTP clients. It maintains a queue of pending requests
@@ -1568,6 +1583,68 @@ declare module "http" {
1568
1583
  * @since v0.11.4
1569
1584
  */
1570
1585
  destroy(): void;
1586
+ /**
1587
+ * Produces a socket/stream to be used for HTTP requests.
1588
+ *
1589
+ * By default, this function is the same as `net.createConnection()`. However,
1590
+ * custom agents may override this method in case greater flexibility is desired.
1591
+ *
1592
+ * A socket/stream can be supplied in one of two ways: by returning the
1593
+ * socket/stream from this function, or by passing the socket/stream to `callback`.
1594
+ *
1595
+ * This method is guaranteed to return an instance of the `net.Socket` class,
1596
+ * a subclass of `stream.Duplex`, unless the user specifies a socket
1597
+ * type other than `net.Socket`.
1598
+ *
1599
+ * `callback` has a signature of `(err, stream)`.
1600
+ * @since v0.11.4
1601
+ * @param options Options containing connection details. Check `createConnection` for the format of the options
1602
+ * @param callback Callback function that receives the created socket
1603
+ */
1604
+ createConnection(
1605
+ options: NetConnectOpts,
1606
+ callback?: (err: Error | null, stream: stream.Duplex) => void,
1607
+ ): stream.Duplex;
1608
+ /**
1609
+ * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
1610
+ *
1611
+ * ```js
1612
+ * socket.setKeepAlive(true, this.keepAliveMsecs);
1613
+ * socket.unref();
1614
+ * return true;
1615
+ * ```
1616
+ *
1617
+ * This method can be overridden by a particular `Agent` subclass. If this
1618
+ * method returns a falsy value, the socket will be destroyed instead of persisting
1619
+ * it for use with the next request.
1620
+ *
1621
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1622
+ * @since v8.1.0
1623
+ */
1624
+ keepSocketAlive(socket: stream.Duplex): void;
1625
+ /**
1626
+ * Called when `socket` is attached to `request` after being persisted because of
1627
+ * the keep-alive options. Default behavior is to:
1628
+ *
1629
+ * ```js
1630
+ * socket.ref();
1631
+ * ```
1632
+ *
1633
+ * This method can be overridden by a particular `Agent` subclass.
1634
+ *
1635
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1636
+ * @since v8.1.0
1637
+ */
1638
+ reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
1639
+ /**
1640
+ * Get a unique name for a set of request options, to determine whether a
1641
+ * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
1642
+ * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
1643
+ * that determine socket reusability.
1644
+ * @since v0.11.4
1645
+ * @param options A set of options providing information for name generation
1646
+ */
1647
+ getName(options?: AgentGetNameOptions): string;
1571
1648
  }
1572
1649
  const METHODS: string[];
1573
1650
  const STATUS_CODES: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.19.1",
3
+ "version": "20.19.3",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -215,6 +215,6 @@
215
215
  "undici-types": "~6.21.0"
216
216
  },
217
217
  "peerDependencies": {},
218
- "typesPublisherContentHash": "cc9b44df0c3d7290cabaa4b43a7a43cb4eda0119a979750949d8687b20ded030",
218
+ "typesPublisherContentHash": "d0d6de51333cb0875f3f866ab97c3894e52a50e2807a95573312ab72c1e1053e",
219
219
  "typeScriptVersion": "5.1"
220
220
  }