@types/node 24.0.5 → 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 +2 -2
- node/http.d.ts +78 -1
- node/package.json +7 -2
node/README.md
CHANGED
@@ -8,8 +8,8 @@ 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
|
15
|
-
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky),
|
15
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), [René](https://github.com/Renegade334), and [Yagiz Nizipli](https://github.com/anonrig).
|
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",
|
@@ -199,6 +199,11 @@
|
|
199
199
|
"name": "René",
|
200
200
|
"githubUsername": "Renegade334",
|
201
201
|
"url": "https://github.com/Renegade334"
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"name": "Yagiz Nizipli",
|
205
|
+
"githubUsername": "anonrig",
|
206
|
+
"url": "https://github.com/anonrig"
|
202
207
|
}
|
203
208
|
],
|
204
209
|
"main": "",
|
@@ -230,6 +235,6 @@
|
|
230
235
|
"undici-types": "~7.8.0"
|
231
236
|
},
|
232
237
|
"peerDependencies": {},
|
233
|
-
"typesPublisherContentHash": "
|
238
|
+
"typesPublisherContentHash": "9d4d0600f3777de66d31fc3650d20edf2918bca4267042e5be25f65fb4e92e06",
|
234
239
|
"typeScriptVersion": "5.1"
|
235
240
|
}
|