@types/node 24.3.3 → 24.5.0
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/buffer.d.ts +1 -1
- node/child_process.d.ts +1 -1
- node/crypto.d.ts +44 -10
- node/dns.d.ts +5 -0
- node/fs/promises.d.ts +22 -0
- node/fs.d.ts +33 -0
- node/http.d.ts +25 -1
- node/index.d.ts +1 -1
- node/inspector.d.ts +187 -4145
- node/inspector.generated.d.ts +4052 -0
- node/module.d.ts +1 -0
- node/net.d.ts +21 -0
- node/package.json +3 -3
- node/sqlite.d.ts +34 -0
- node/tls.d.ts +32 -0
- node/ts5.6/index.d.ts +1 -1
- node/ts5.7/index.d.ts +1 -1
- node/url.d.ts +8 -5
- node/util.d.ts +6 -4
- node/vm.d.ts +73 -10
- node/wasi.d.ts +21 -0
- node/web-globals/navigator.d.ts +3 -0
- node/worker_threads.d.ts +29 -0
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: Mon, 15 Sep 2025 20:02:30 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/buffer.d.ts
CHANGED
@@ -139,7 +139,7 @@ declare module "buffer" {
|
|
139
139
|
type?: string | undefined;
|
140
140
|
}
|
141
141
|
/**
|
142
|
-
* A
|
142
|
+
* A `Blob` encapsulates immutable, raw data that can be safely shared across
|
143
143
|
* multiple worker threads.
|
144
144
|
* @since v15.7.0, v14.18.0
|
145
145
|
*/
|
node/child_process.d.ts
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
* the parent Node.js process and the spawned subprocess. These pipes have
|
25
25
|
* limited (and platform-specific) capacity. If the subprocess writes to
|
26
26
|
* stdout in excess of that limit without the output being captured, the
|
27
|
-
* subprocess blocks waiting for the pipe buffer to accept more data. This is
|
27
|
+
* subprocess blocks, waiting for the pipe buffer to accept more data. This is
|
28
28
|
* identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
|
29
29
|
*
|
30
30
|
* The command lookup is performed using the `options.env.PATH` environment
|
node/crypto.d.ts
CHANGED
@@ -3363,11 +3363,36 @@ declare module "crypto" {
|
|
3363
3363
|
options: { privateKey: KeyObject; publicKey: KeyObject },
|
3364
3364
|
callback: (err: Error | null, secret: Buffer) => void,
|
3365
3365
|
): void;
|
3366
|
+
interface OneShotDigestOptions {
|
3367
|
+
/**
|
3368
|
+
* Encoding used to encode the returned digest.
|
3369
|
+
* @default 'hex'
|
3370
|
+
*/
|
3371
|
+
outputEncoding?: BinaryToTextEncoding | "buffer" | undefined;
|
3372
|
+
/**
|
3373
|
+
* For XOF hash functions such as 'shake256', the outputLength option
|
3374
|
+
* can be used to specify the desired output length in bytes.
|
3375
|
+
*/
|
3376
|
+
outputLength?: number | undefined;
|
3377
|
+
}
|
3378
|
+
interface OneShotDigestOptionsWithStringEncoding extends OneShotDigestOptions {
|
3379
|
+
outputEncoding?: BinaryToTextEncoding | undefined;
|
3380
|
+
}
|
3381
|
+
interface OneShotDigestOptionsWithBufferEncoding extends OneShotDigestOptions {
|
3382
|
+
outputEncoding: "buffer";
|
3383
|
+
}
|
3366
3384
|
/**
|
3367
|
-
* A utility for creating one-shot hash digests of data. It can be faster than
|
3368
|
-
*
|
3369
|
-
*
|
3370
|
-
*
|
3385
|
+
* A utility for creating one-shot hash digests of data. It can be faster than
|
3386
|
+
* the object-based `crypto.createHash()` when hashing a smaller amount of data
|
3387
|
+
* (<= 5MB) that's readily available. If the data can be big or if it is streamed,
|
3388
|
+
* it's still recommended to use `crypto.createHash()` instead.
|
3389
|
+
*
|
3390
|
+
* The `algorithm` is dependent on the available algorithms supported by the
|
3391
|
+
* version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
|
3392
|
+
* On recent releases of OpenSSL, `openssl list -digest-algorithms` will
|
3393
|
+
* display the available digest algorithms.
|
3394
|
+
*
|
3395
|
+
* If `options` is a string, then it specifies the `outputEncoding`.
|
3371
3396
|
*
|
3372
3397
|
* Example:
|
3373
3398
|
*
|
@@ -3387,16 +3412,25 @@ declare module "crypto" {
|
|
3387
3412
|
* console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));
|
3388
3413
|
* ```
|
3389
3414
|
* @since v21.7.0, v20.12.0
|
3390
|
-
* @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different
|
3391
|
-
*
|
3392
|
-
*
|
3415
|
+
* @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different
|
3416
|
+
* input encoding is desired for a string input, user could encode the string
|
3417
|
+
* into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing
|
3418
|
+
* the encoded `TypedArray` into this API instead.
|
3393
3419
|
*/
|
3394
|
-
function hash(algorithm: string, data: BinaryLike, outputEncoding?: BinaryToTextEncoding): string;
|
3395
|
-
function hash(algorithm: string, data: BinaryLike, outputEncoding: "buffer"): Buffer;
|
3396
3420
|
function hash(
|
3397
3421
|
algorithm: string,
|
3398
3422
|
data: BinaryLike,
|
3399
|
-
|
3423
|
+
options?: OneShotDigestOptionsWithStringEncoding | BinaryToTextEncoding,
|
3424
|
+
): string;
|
3425
|
+
function hash(
|
3426
|
+
algorithm: string,
|
3427
|
+
data: BinaryLike,
|
3428
|
+
options: OneShotDigestOptionsWithBufferEncoding | "buffer",
|
3429
|
+
): Buffer;
|
3430
|
+
function hash(
|
3431
|
+
algorithm: string,
|
3432
|
+
data: BinaryLike,
|
3433
|
+
options: OneShotDigestOptions | BinaryToTextEncoding | "buffer",
|
3400
3434
|
): string | Buffer;
|
3401
3435
|
type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
|
3402
3436
|
interface CipherInfoOptions {
|
node/dns.d.ts
CHANGED
node/fs/promises.d.ts
CHANGED
@@ -20,6 +20,8 @@ declare module "fs/promises" {
|
|
20
20
|
CopyOptions,
|
21
21
|
Dir,
|
22
22
|
Dirent,
|
23
|
+
DisposableTempDir,
|
24
|
+
EncodingOption,
|
23
25
|
GlobOptions,
|
24
26
|
GlobOptionsWithFileTypes,
|
25
27
|
GlobOptionsWithoutFileTypes,
|
@@ -961,6 +963,26 @@ declare module "fs/promises" {
|
|
961
963
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
962
964
|
*/
|
963
965
|
function mkdtemp(prefix: string, options?: ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
|
966
|
+
/**
|
967
|
+
* The resulting Promise holds an async-disposable object whose `path` property
|
968
|
+
* holds the created directory path. When the object is disposed, the directory
|
969
|
+
* and its contents will be removed asynchronously if it still exists. If the
|
970
|
+
* directory cannot be deleted, disposal will throw an error. The object has an
|
971
|
+
* async `remove()` method which will perform the same task.
|
972
|
+
*
|
973
|
+
* Both this function and the disposal function on the resulting object are
|
974
|
+
* async, so it should be used with `await` + `await using` as in
|
975
|
+
* `await using dir = await fsPromises.mkdtempDisposable('prefix')`.
|
976
|
+
*
|
977
|
+
* <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
|
978
|
+
*
|
979
|
+
* For detailed information, see the documentation of `fsPromises.mkdtemp()`.
|
980
|
+
*
|
981
|
+
* The optional `options` argument can be a string specifying an encoding, or an
|
982
|
+
* object with an `encoding` property specifying the character encoding to use.
|
983
|
+
* @since v24.4.0
|
984
|
+
*/
|
985
|
+
function mkdtempDisposable(prefix: PathLike, options?: EncodingOption): Promise<DisposableTempDir>;
|
964
986
|
/**
|
965
987
|
* Asynchronously writes data to a file, replacing the file if it already exists. `data` can be a string, a buffer, an
|
966
988
|
* [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface), or an
|
node/fs.d.ts
CHANGED
@@ -1966,6 +1966,39 @@ declare module "fs" {
|
|
1966
1966
|
* @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
|
1967
1967
|
*/
|
1968
1968
|
export function mkdtempSync(prefix: string, options?: EncodingOption): string | Buffer;
|
1969
|
+
export interface DisposableTempDir extends AsyncDisposable {
|
1970
|
+
/**
|
1971
|
+
* The path of the created directory.
|
1972
|
+
*/
|
1973
|
+
path: string;
|
1974
|
+
/**
|
1975
|
+
* A function which removes the created directory.
|
1976
|
+
*/
|
1977
|
+
remove(): Promise<void>;
|
1978
|
+
/**
|
1979
|
+
* The same as `remove`.
|
1980
|
+
*/
|
1981
|
+
[Symbol.asyncDispose](): Promise<void>;
|
1982
|
+
}
|
1983
|
+
/**
|
1984
|
+
* Returns a disposable object whose `path` property holds the created directory
|
1985
|
+
* path. When the object is disposed, the directory and its contents will be
|
1986
|
+
* removed if it still exists. If the directory cannot be deleted, disposal will
|
1987
|
+
* throw an error. The object has a `remove()` method which will perform the same
|
1988
|
+
* task.
|
1989
|
+
*
|
1990
|
+
* <!-- TODO: link MDN docs for disposables once https://github.com/mdn/content/pull/38027 lands -->
|
1991
|
+
*
|
1992
|
+
* For detailed information, see the documentation of `fs.mkdtemp()`.
|
1993
|
+
*
|
1994
|
+
* There is no callback-based version of this API because it is designed for use
|
1995
|
+
* with the `using` syntax.
|
1996
|
+
*
|
1997
|
+
* The optional `options` argument can be a string specifying an encoding, or an
|
1998
|
+
* object with an `encoding` property specifying the character encoding to use.
|
1999
|
+
* @since v24.4.0
|
2000
|
+
*/
|
2001
|
+
export function mkdtempDisposableSync(prefix: string, options?: EncodingOption): DisposableTempDir;
|
1969
2002
|
/**
|
1970
2003
|
* Reads the contents of a directory. The callback gets two arguments `(err, files)` where `files` is an array of the names of the files in the directory excluding `'.'` and `'..'`.
|
1971
2004
|
*
|
node/http.d.ts
CHANGED
@@ -1419,6 +1419,14 @@ declare module "http" {
|
|
1419
1419
|
*/
|
1420
1420
|
destroy(error?: Error): this;
|
1421
1421
|
}
|
1422
|
+
interface ProxyEnv extends NodeJS.ProcessEnv {
|
1423
|
+
HTTP_PROXY?: string | undefined;
|
1424
|
+
HTTPS_PROXY?: string | undefined;
|
1425
|
+
NO_PROXY?: string | undefined;
|
1426
|
+
http_proxy?: string | undefined;
|
1427
|
+
https_proxy?: string | undefined;
|
1428
|
+
no_proxy?: string | undefined;
|
1429
|
+
}
|
1422
1430
|
interface AgentOptions extends Partial<TcpSocketConnectOpts> {
|
1423
1431
|
/**
|
1424
1432
|
* Keep sockets around in a pool to be used by other requests in the future. Default = false
|
@@ -1450,6 +1458,22 @@ declare module "http" {
|
|
1450
1458
|
* @default `lifo`
|
1451
1459
|
*/
|
1452
1460
|
scheduling?: "fifo" | "lifo" | undefined;
|
1461
|
+
/**
|
1462
|
+
* Environment variables for proxy configuration. See
|
1463
|
+
* [Built-in Proxy Support](https://nodejs.org/docs/latest-v24.x/api/http.html#built-in-proxy-support) for details.
|
1464
|
+
* @since v24.5.0
|
1465
|
+
*/
|
1466
|
+
proxyEnv?: ProxyEnv | undefined;
|
1467
|
+
/**
|
1468
|
+
* Default port to use when the port is not specified in requests.
|
1469
|
+
* @since v24.5.0
|
1470
|
+
*/
|
1471
|
+
defaultPort?: number | undefined;
|
1472
|
+
/**
|
1473
|
+
* The protocol to use for the agent.
|
1474
|
+
* @since v24.5.0
|
1475
|
+
*/
|
1476
|
+
protocol?: string | undefined;
|
1453
1477
|
}
|
1454
1478
|
/**
|
1455
1479
|
* An `Agent` is responsible for managing connection persistence
|
@@ -2028,7 +2052,7 @@ declare module "http" {
|
|
2028
2052
|
*/
|
2029
2053
|
const maxHeaderSize: number;
|
2030
2054
|
/**
|
2031
|
-
* A browser-compatible implementation of
|
2055
|
+
* A browser-compatible implementation of `WebSocket`.
|
2032
2056
|
* @since v22.5.0
|
2033
2057
|
*/
|
2034
2058
|
const WebSocket: typeof import("undici-types").WebSocket;
|
node/index.d.ts
CHANGED
@@ -57,7 +57,6 @@
|
|
57
57
|
/// <reference path="diagnostics_channel.d.ts" />
|
58
58
|
/// <reference path="dns.d.ts" />
|
59
59
|
/// <reference path="dns/promises.d.ts" />
|
60
|
-
/// <reference path="dns/promises.d.ts" />
|
61
60
|
/// <reference path="domain.d.ts" />
|
62
61
|
/// <reference path="events.d.ts" />
|
63
62
|
/// <reference path="fs.d.ts" />
|
@@ -66,6 +65,7 @@
|
|
66
65
|
/// <reference path="http2.d.ts" />
|
67
66
|
/// <reference path="https.d.ts" />
|
68
67
|
/// <reference path="inspector.d.ts" />
|
68
|
+
/// <reference path="inspector.generated.d.ts" />
|
69
69
|
/// <reference path="module.d.ts" />
|
70
70
|
/// <reference path="net.d.ts" />
|
71
71
|
/// <reference path="os.d.ts" />
|