@types/node 18.19.112 → 18.19.113

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 v18.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/v18.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 16 Jun 2025 11:02:21 GMT
11
+ * Last updated: Sat, 28 Jun 2025 07:33:25 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node v18.19/http.d.ts CHANGED
@@ -44,7 +44,7 @@ declare module "http" {
44
44
  import { URL } from "node:url";
45
45
  import { EventEmitter } from "node:events";
46
46
  import { LookupOptions } from "node:dns";
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;
@@ -1430,6 +1430,21 @@ declare module "http" {
1430
1430
  */
1431
1431
  scheduling?: "fifo" | "lifo" | undefined;
1432
1432
  }
1433
+ interface AgentGetNameOptions {
1434
+ /**
1435
+ * A domain name or IP address of the server to issue the request to
1436
+ */
1437
+ host?: string | undefined;
1438
+ /**
1439
+ * Port of remote server
1440
+ */
1441
+ port?: number | undefined;
1442
+ /**
1443
+ * Local interface to bind for network connections when issuing the request
1444
+ */
1445
+ localAddress?: string | undefined;
1446
+ family?: 4 | 6 | undefined;
1447
+ }
1433
1448
  /**
1434
1449
  * An `Agent` is responsible for managing connection persistence
1435
1450
  * and reuse for HTTP clients. It maintains a queue of pending requests
@@ -1538,6 +1553,68 @@ declare module "http" {
1538
1553
  * @since v0.11.4
1539
1554
  */
1540
1555
  destroy(): void;
1556
+ /**
1557
+ * Produces a socket/stream to be used for HTTP requests.
1558
+ *
1559
+ * By default, this function is the same as `net.createConnection()`. However,
1560
+ * custom agents may override this method in case greater flexibility is desired.
1561
+ *
1562
+ * A socket/stream can be supplied in one of two ways: by returning the
1563
+ * socket/stream from this function, or by passing the socket/stream to `callback`.
1564
+ *
1565
+ * This method is guaranteed to return an instance of the `net.Socket` class,
1566
+ * a subclass of `stream.Duplex`, unless the user specifies a socket
1567
+ * type other than `net.Socket`.
1568
+ *
1569
+ * `callback` has a signature of `(err, stream)`.
1570
+ * @since v0.11.4
1571
+ * @param options Options containing connection details. Check `createConnection` for the format of the options
1572
+ * @param callback Callback function that receives the created socket
1573
+ */
1574
+ createConnection(
1575
+ options: NetConnectOpts,
1576
+ callback?: (err: Error | null, stream: stream.Duplex) => void,
1577
+ ): stream.Duplex;
1578
+ /**
1579
+ * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
1580
+ *
1581
+ * ```js
1582
+ * socket.setKeepAlive(true, this.keepAliveMsecs);
1583
+ * socket.unref();
1584
+ * return true;
1585
+ * ```
1586
+ *
1587
+ * This method can be overridden by a particular `Agent` subclass. If this
1588
+ * method returns a falsy value, the socket will be destroyed instead of persisting
1589
+ * it for use with the next request.
1590
+ *
1591
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1592
+ * @since v8.1.0
1593
+ */
1594
+ keepSocketAlive(socket: stream.Duplex): void;
1595
+ /**
1596
+ * Called when `socket` is attached to `request` after being persisted because of
1597
+ * the keep-alive options. Default behavior is to:
1598
+ *
1599
+ * ```js
1600
+ * socket.ref();
1601
+ * ```
1602
+ *
1603
+ * This method can be overridden by a particular `Agent` subclass.
1604
+ *
1605
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1606
+ * @since v8.1.0
1607
+ */
1608
+ reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
1609
+ /**
1610
+ * Get a unique name for a set of request options, to determine whether a
1611
+ * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
1612
+ * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
1613
+ * that determine socket reusability.
1614
+ * @since v0.11.4
1615
+ * @param options A set of options providing information for name generation
1616
+ */
1617
+ getName(options?: AgentGetNameOptions): string;
1541
1618
  }
1542
1619
  const METHODS: string[];
1543
1620
  const STATUS_CODES: {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.19.112",
3
+ "version": "18.19.113",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~5.26.4"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "3b0022e6fd68674bfe09bfec92263763b1fba74ce671da541765e24b2af05d76",
223
+ "typesPublisherContentHash": "4fa7cb0df5628a9f401679ba67af296b3949995e55f4a7b8a454b04328499e9f",
224
224
  "typeScriptVersion": "5.1"
225
225
  }