@types/node 24.0.6 → 24.0.7
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/README.md +1 -1
- node/http.d.ts +78 -1
- node/package.json +2 -2
node/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.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
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/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;
|
@@ -1451,6 +1451,21 @@ declare module "http" {
|
|
1451
1451
|
*/
|
1452
1452
|
scheduling?: "fifo" | "lifo" | undefined;
|
1453
1453
|
}
|
1454
|
+
interface AgentGetNameOptions {
|
1455
|
+
/**
|
1456
|
+
* A domain name or IP address of the server to issue the request to
|
1457
|
+
*/
|
1458
|
+
host?: string | undefined;
|
1459
|
+
/**
|
1460
|
+
* Port of remote server
|
1461
|
+
*/
|
1462
|
+
port?: number | undefined;
|
1463
|
+
/**
|
1464
|
+
* Local interface to bind for network connections when issuing the request
|
1465
|
+
*/
|
1466
|
+
localAddress?: string | undefined;
|
1467
|
+
family?: 4 | 6 | undefined;
|
1468
|
+
}
|
1454
1469
|
/**
|
1455
1470
|
* An `Agent` is responsible for managing connection persistence
|
1456
1471
|
* and reuse for HTTP clients. It maintains a queue of pending requests
|
@@ -1570,6 +1585,68 @@ declare module "http" {
|
|
1570
1585
|
* @since v0.11.4
|
1571
1586
|
*/
|
1572
1587
|
destroy(): void;
|
1588
|
+
/**
|
1589
|
+
* Produces a socket/stream to be used for HTTP requests.
|
1590
|
+
*
|
1591
|
+
* By default, this function is the same as `net.createConnection()`. However,
|
1592
|
+
* custom agents may override this method in case greater flexibility is desired.
|
1593
|
+
*
|
1594
|
+
* A socket/stream can be supplied in one of two ways: by returning the
|
1595
|
+
* socket/stream from this function, or by passing the socket/stream to `callback`.
|
1596
|
+
*
|
1597
|
+
* This method is guaranteed to return an instance of the `net.Socket` class,
|
1598
|
+
* a subclass of `stream.Duplex`, unless the user specifies a socket
|
1599
|
+
* type other than `net.Socket`.
|
1600
|
+
*
|
1601
|
+
* `callback` has a signature of `(err, stream)`.
|
1602
|
+
* @since v0.11.4
|
1603
|
+
* @param options Options containing connection details. Check `createConnection` for the format of the options
|
1604
|
+
* @param callback Callback function that receives the created socket
|
1605
|
+
*/
|
1606
|
+
createConnection(
|
1607
|
+
options: NetConnectOpts,
|
1608
|
+
callback?: (err: Error | null, stream: stream.Duplex) => void,
|
1609
|
+
): stream.Duplex;
|
1610
|
+
/**
|
1611
|
+
* Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
|
1612
|
+
*
|
1613
|
+
* ```js
|
1614
|
+
* socket.setKeepAlive(true, this.keepAliveMsecs);
|
1615
|
+
* socket.unref();
|
1616
|
+
* return true;
|
1617
|
+
* ```
|
1618
|
+
*
|
1619
|
+
* This method can be overridden by a particular `Agent` subclass. If this
|
1620
|
+
* method returns a falsy value, the socket will be destroyed instead of persisting
|
1621
|
+
* it for use with the next request.
|
1622
|
+
*
|
1623
|
+
* The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
|
1624
|
+
* @since v8.1.0
|
1625
|
+
*/
|
1626
|
+
keepSocketAlive(socket: stream.Duplex): void;
|
1627
|
+
/**
|
1628
|
+
* Called when `socket` is attached to `request` after being persisted because of
|
1629
|
+
* the keep-alive options. Default behavior is to:
|
1630
|
+
*
|
1631
|
+
* ```js
|
1632
|
+
* socket.ref();
|
1633
|
+
* ```
|
1634
|
+
*
|
1635
|
+
* This method can be overridden by a particular `Agent` subclass.
|
1636
|
+
*
|
1637
|
+
* The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
|
1638
|
+
* @since v8.1.0
|
1639
|
+
*/
|
1640
|
+
reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
|
1641
|
+
/**
|
1642
|
+
* Get a unique name for a set of request options, to determine whether a
|
1643
|
+
* connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
|
1644
|
+
* the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
|
1645
|
+
* that determine socket reusability.
|
1646
|
+
* @since v0.11.4
|
1647
|
+
* @param options A set of options providing information for name generation
|
1648
|
+
*/
|
1649
|
+
getName(options?: AgentGetNameOptions): string;
|
1573
1650
|
}
|
1574
1651
|
const METHODS: string[];
|
1575
1652
|
const STATUS_CODES: {
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "24.0.
|
3
|
+
"version": "24.0.7",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -235,6 +235,6 @@
|
|
235
235
|
"undici-types": "~7.8.0"
|
236
236
|
},
|
237
237
|
"peerDependencies": {},
|
238
|
-
"typesPublisherContentHash": "
|
238
|
+
"typesPublisherContentHash": "9d4d0600f3777de66d31fc3650d20edf2918bca4267042e5be25f65fb4e92e06",
|
239
239
|
"typeScriptVersion": "5.1"
|
240
240
|
}
|