@types/node 22.15.13 → 22.18.9
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 v22.18/README.md +15 -0
- node/assert.d.ts → node v22.18/assert.d.ts +19 -0
- node/buffer.d.ts → node v22.18/buffer.d.ts +6 -2
- node/child_process.d.ts → node v22.18/child_process.d.ts +26 -122
- node/compatibility/disposable.d.ts → node v22.18/compatibility/disposable.d.ts +0 -2
- node/compatibility/indexable.d.ts → node v22.18/compatibility/indexable.d.ts +0 -3
- node/compatibility/iterators.d.ts → node v22.18/compatibility/iterators.d.ts +0 -1
- node/crypto.d.ts → node v22.18/crypto.d.ts +17 -1
- node/diagnostics_channel.d.ts → node v22.18/diagnostics_channel.d.ts +18 -13
- node/dns/promises.d.ts → node v22.18/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.18/dns.d.ts +73 -20
- node/events.d.ts → node v22.18/events.d.ts +79 -34
- node/fs/promises.d.ts → node v22.18/fs/promises.d.ts +57 -39
- node/fs.d.ts → node v22.18/fs.d.ts +98 -47
- node v22.18/globals.d.ts +172 -0
- node/http.d.ts → node v22.18/http.d.ts +72 -6
- node/http2.d.ts → node v22.18/http2.d.ts +81 -2
- node/https.d.ts → node v22.18/https.d.ts +5 -0
- node/index.d.ts → node v22.18/index.d.ts +7 -3
- node/inspector.d.ts → node v22.18/inspector.generated.d.ts +219 -10
- node/module.d.ts → node v22.18/module.d.ts +136 -17
- node/net.d.ts → node v22.18/net.d.ts +3 -3
- node/package.json → node v22.18/package.json +3 -83
- node/perf_hooks.d.ts → node v22.18/perf_hooks.d.ts +2 -2
- node/process.d.ts → node v22.18/process.d.ts +3 -4
- node/readline/promises.d.ts → node v22.18/readline/promises.d.ts +0 -1
- node/repl.d.ts → node v22.18/repl.d.ts +3 -5
- node/sqlite.d.ts → node v22.18/sqlite.d.ts +207 -0
- node/stream/web.d.ts → node v22.18/stream/web.d.ts +8 -0
- node/stream.d.ts → node v22.18/stream.d.ts +5 -10
- node v22.18/test.d.ts +2162 -0
- node/ts5.6/index.d.ts → node v22.18/ts5.6/index.d.ts +7 -3
- node/url.d.ts → node v22.18/url.d.ts +12 -3
- node/util.d.ts → node v22.18/util.d.ts +20 -5
- node/v8.d.ts → node v22.18/v8.d.ts +60 -30
- node/vm.d.ts → node v22.18/vm.d.ts +61 -8
- node v22.18/web-globals/abortcontroller.d.ts +34 -0
- node v22.18/web-globals/domexception.d.ts +68 -0
- node v22.18/web-globals/events.d.ts +97 -0
- node v22.18/web-globals/fetch.d.ts +46 -0
- node v22.18/web-globals/navigator.d.ts +22 -0
- node v22.18/web-globals/storage.d.ts +24 -0
- node/worker_threads.d.ts → node v22.18/worker_threads.d.ts +105 -74
- node/zlib.d.ts → node v22.18/zlib.d.ts +8 -2
- node/README.md +0 -15
- node/dom-events.d.ts +0 -124
- node/globals.d.ts +0 -371
- node/test.d.ts +0 -2280
- {node → node v22.18}/LICENSE +0 -0
- {node → node v22.18}/assert/strict.d.ts +0 -0
- node/async_hooks.d.ts → node v22.18/async_hooks.d.ts +1 -1
- {node → node v22.18}/buffer.buffer.d.ts +0 -0
- {node → node v22.18}/cluster.d.ts +0 -0
- {node → node v22.18}/compatibility/index.d.ts +0 -0
- {node → node v22.18}/console.d.ts +0 -0
- {node → node v22.18}/constants.d.ts +0 -0
- {node → node v22.18}/dgram.d.ts +0 -0
- {node → node v22.18}/domain.d.ts +0 -0
- {node → node v22.18}/globals.typedarray.d.ts +0 -0
- {node → node v22.18}/os.d.ts +0 -0
- {node → node v22.18}/path.d.ts +0 -0
- {node → node v22.18}/punycode.d.ts +0 -0
- {node → node v22.18}/querystring.d.ts +0 -0
- {node → node v22.18}/readline.d.ts +0 -0
- {node → node v22.18}/sea.d.ts +0 -0
- {node → node v22.18}/stream/consumers.d.ts +0 -0
- {node → node v22.18}/stream/promises.d.ts +0 -0
- {node → node v22.18}/string_decoder.d.ts +0 -0
- {node → node v22.18}/timers/promises.d.ts +0 -0
- {node → node v22.18}/timers.d.ts +0 -0
- {node → node v22.18}/tls.d.ts +0 -0
- {node → node v22.18}/trace_events.d.ts +0 -0
- {node → node v22.18}/ts5.6/buffer.buffer.d.ts +0 -0
- {node → node v22.18}/ts5.6/globals.typedarray.d.ts +0 -0
- {node → node v22.18}/tty.d.ts +0 -0
- {node → node v22.18}/wasi.d.ts +0 -0
node v22.18/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
> `npm install --save @types/node`
|
|
3
|
+
|
|
4
|
+
# Summary
|
|
5
|
+
This package contains type definitions for node (https://nodejs.org/).
|
|
6
|
+
|
|
7
|
+
# Details
|
|
8
|
+
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v22.
|
|
9
|
+
|
|
10
|
+
### Additional Details
|
|
11
|
+
* Last updated: Thu, 09 Oct 2025 17:35:09 GMT
|
|
12
|
+
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
|
+
|
|
14
|
+
# Credits
|
|
15
|
+
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [David Junger](https://github.com/touffy), [Mohsen Azimi](https://github.com/mohsen1), [Nikita Galkin](https://github.com/galkin), [Sebastian Silbermann](https://github.com/eps1lon), [Wilco Bakker](https://github.com/WilcoBakker), [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), and [René](https://github.com/Renegade334).
|
|
@@ -11,6 +11,25 @@ declare module "assert" {
|
|
|
11
11
|
*/
|
|
12
12
|
function assert(value: unknown, message?: string | Error): asserts value;
|
|
13
13
|
namespace assert {
|
|
14
|
+
type AssertMethodNames =
|
|
15
|
+
| "deepEqual"
|
|
16
|
+
| "deepStrictEqual"
|
|
17
|
+
| "doesNotMatch"
|
|
18
|
+
| "doesNotReject"
|
|
19
|
+
| "doesNotThrow"
|
|
20
|
+
| "equal"
|
|
21
|
+
| "fail"
|
|
22
|
+
| "ifError"
|
|
23
|
+
| "match"
|
|
24
|
+
| "notDeepEqual"
|
|
25
|
+
| "notDeepStrictEqual"
|
|
26
|
+
| "notEqual"
|
|
27
|
+
| "notStrictEqual"
|
|
28
|
+
| "ok"
|
|
29
|
+
| "partialDeepStrictEqual"
|
|
30
|
+
| "rejects"
|
|
31
|
+
| "strictEqual"
|
|
32
|
+
| "throws";
|
|
14
33
|
/**
|
|
15
34
|
* Indicates the failure of an assertion. All errors thrown by the `node:assert` module will be instances of the `AssertionError` class.
|
|
16
35
|
*/
|
|
@@ -118,7 +118,6 @@ declare module "buffer" {
|
|
|
118
118
|
* Resolves a `'blob:nodedata:...'` an associated `Blob` object registered using
|
|
119
119
|
* a prior call to `URL.createObjectURL()`.
|
|
120
120
|
* @since v16.7.0
|
|
121
|
-
* @experimental
|
|
122
121
|
* @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
|
|
123
122
|
*/
|
|
124
123
|
export function resolveObjectURL(id: string): Blob | undefined;
|
|
@@ -140,7 +139,7 @@ declare module "buffer" {
|
|
|
140
139
|
type?: string | undefined;
|
|
141
140
|
}
|
|
142
141
|
/**
|
|
143
|
-
* A
|
|
142
|
+
* A `Blob` encapsulates immutable, raw data that can be safely shared across
|
|
144
143
|
* multiple worker threads.
|
|
145
144
|
* @since v15.7.0, v14.18.0
|
|
146
145
|
*/
|
|
@@ -1702,6 +1701,8 @@ declare module "buffer" {
|
|
|
1702
1701
|
* @return A reference to `buf`.
|
|
1703
1702
|
*/
|
|
1704
1703
|
fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
|
|
1704
|
+
fill(value: string | Uint8Array | number, offset: number, encoding: BufferEncoding): this;
|
|
1705
|
+
fill(value: string | Uint8Array | number, encoding: BufferEncoding): this;
|
|
1705
1706
|
/**
|
|
1706
1707
|
* If `value` is:
|
|
1707
1708
|
*
|
|
@@ -1771,6 +1772,7 @@ declare module "buffer" {
|
|
|
1771
1772
|
* @return The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
|
|
1772
1773
|
*/
|
|
1773
1774
|
indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
|
1775
|
+
indexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number;
|
|
1774
1776
|
/**
|
|
1775
1777
|
* Identical to `buf.indexOf()`, except the last occurrence of `value` is found
|
|
1776
1778
|
* rather than the first occurrence.
|
|
@@ -1839,6 +1841,7 @@ declare module "buffer" {
|
|
|
1839
1841
|
* @return The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.
|
|
1840
1842
|
*/
|
|
1841
1843
|
lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
|
|
1844
|
+
lastIndexOf(value: string | number | Uint8Array, encoding: BufferEncoding): number;
|
|
1842
1845
|
/**
|
|
1843
1846
|
* Equivalent to `buf.indexOf() !== -1`.
|
|
1844
1847
|
*
|
|
@@ -1869,6 +1872,7 @@ declare module "buffer" {
|
|
|
1869
1872
|
* @return `true` if `value` was found in `buf`, `false` otherwise.
|
|
1870
1873
|
*/
|
|
1871
1874
|
includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
|
|
1875
|
+
includes(value: string | number | Buffer, encoding: BufferEncoding): boolean;
|
|
1872
1876
|
}
|
|
1873
1877
|
var Buffer: BufferConstructor;
|
|
1874
1878
|
/**
|
|
@@ -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
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/child_process.js)
|
|
67
67
|
*/
|
|
68
68
|
declare module "child_process" {
|
|
69
|
-
import { ObjectEncodingOptions } from "node:fs";
|
|
70
69
|
import { Abortable, EventEmitter } from "node:events";
|
|
71
70
|
import * as dgram from "node:dgram";
|
|
72
71
|
import * as net from "node:net";
|
|
@@ -887,12 +886,13 @@ declare module "child_process" {
|
|
|
887
886
|
signal?: AbortSignal | undefined;
|
|
888
887
|
maxBuffer?: number | undefined;
|
|
889
888
|
killSignal?: NodeJS.Signals | number | undefined;
|
|
889
|
+
encoding?: string | null | undefined;
|
|
890
890
|
}
|
|
891
891
|
interface ExecOptionsWithStringEncoding extends ExecOptions {
|
|
892
|
-
encoding
|
|
892
|
+
encoding?: BufferEncoding | undefined;
|
|
893
893
|
}
|
|
894
894
|
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
|
895
|
-
encoding:
|
|
895
|
+
encoding: "buffer" | null; // specify `null`.
|
|
896
896
|
}
|
|
897
897
|
interface ExecException extends Error {
|
|
898
898
|
cmd?: string | undefined;
|
|
@@ -995,38 +995,19 @@ declare module "child_process" {
|
|
|
995
995
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
996
996
|
function exec(
|
|
997
997
|
command: string,
|
|
998
|
-
options:
|
|
999
|
-
encoding: "buffer" | null;
|
|
1000
|
-
} & ExecOptions,
|
|
998
|
+
options: ExecOptionsWithBufferEncoding,
|
|
1001
999
|
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1002
1000
|
): ChildProcess;
|
|
1003
|
-
// `options` with well
|
|
1004
|
-
function exec(
|
|
1005
|
-
command: string,
|
|
1006
|
-
options: {
|
|
1007
|
-
encoding: BufferEncoding;
|
|
1008
|
-
} & ExecOptions,
|
|
1009
|
-
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
1010
|
-
): ChildProcess;
|
|
1011
|
-
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
1012
|
-
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
1013
|
-
function exec(
|
|
1014
|
-
command: string,
|
|
1015
|
-
options: {
|
|
1016
|
-
encoding: BufferEncoding;
|
|
1017
|
-
} & ExecOptions,
|
|
1018
|
-
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1019
|
-
): ChildProcess;
|
|
1020
|
-
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
1001
|
+
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1021
1002
|
function exec(
|
|
1022
1003
|
command: string,
|
|
1023
|
-
options:
|
|
1004
|
+
options: ExecOptionsWithStringEncoding,
|
|
1024
1005
|
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
1025
1006
|
): ChildProcess;
|
|
1026
1007
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
1027
1008
|
function exec(
|
|
1028
1009
|
command: string,
|
|
1029
|
-
options:
|
|
1010
|
+
options: ExecOptions | undefined | null,
|
|
1030
1011
|
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1031
1012
|
): ChildProcess;
|
|
1032
1013
|
interface PromiseWithChild<T> extends Promise<T> {
|
|
@@ -1039,32 +1020,21 @@ declare module "child_process" {
|
|
|
1039
1020
|
}>;
|
|
1040
1021
|
function __promisify__(
|
|
1041
1022
|
command: string,
|
|
1042
|
-
options:
|
|
1043
|
-
encoding: "buffer" | null;
|
|
1044
|
-
} & ExecOptions,
|
|
1023
|
+
options: ExecOptionsWithBufferEncoding,
|
|
1045
1024
|
): PromiseWithChild<{
|
|
1046
1025
|
stdout: Buffer;
|
|
1047
1026
|
stderr: Buffer;
|
|
1048
1027
|
}>;
|
|
1049
1028
|
function __promisify__(
|
|
1050
1029
|
command: string,
|
|
1051
|
-
options:
|
|
1052
|
-
encoding: BufferEncoding;
|
|
1053
|
-
} & ExecOptions,
|
|
1030
|
+
options: ExecOptionsWithStringEncoding,
|
|
1054
1031
|
): PromiseWithChild<{
|
|
1055
1032
|
stdout: string;
|
|
1056
1033
|
stderr: string;
|
|
1057
1034
|
}>;
|
|
1058
1035
|
function __promisify__(
|
|
1059
1036
|
command: string,
|
|
1060
|
-
options: ExecOptions,
|
|
1061
|
-
): PromiseWithChild<{
|
|
1062
|
-
stdout: string;
|
|
1063
|
-
stderr: string;
|
|
1064
|
-
}>;
|
|
1065
|
-
function __promisify__(
|
|
1066
|
-
command: string,
|
|
1067
|
-
options?: (ObjectEncodingOptions & ExecOptions) | null,
|
|
1037
|
+
options: ExecOptions | undefined | null,
|
|
1068
1038
|
): PromiseWithChild<{
|
|
1069
1039
|
stdout: string | Buffer;
|
|
1070
1040
|
stderr: string | Buffer;
|
|
@@ -1076,16 +1046,16 @@ declare module "child_process" {
|
|
|
1076
1046
|
windowsVerbatimArguments?: boolean | undefined;
|
|
1077
1047
|
shell?: boolean | string | undefined;
|
|
1078
1048
|
signal?: AbortSignal | undefined;
|
|
1049
|
+
encoding?: string | null | undefined;
|
|
1079
1050
|
}
|
|
1080
1051
|
interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
|
1081
|
-
encoding
|
|
1052
|
+
encoding?: BufferEncoding | undefined;
|
|
1082
1053
|
}
|
|
1083
1054
|
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
|
1084
1055
|
encoding: "buffer" | null;
|
|
1085
1056
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
}
|
|
1057
|
+
/** @deprecated Use `ExecFileOptions` instead. */
|
|
1058
|
+
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
|
|
1089
1059
|
type ExecFileException =
|
|
1090
1060
|
& Omit<ExecException, "code">
|
|
1091
1061
|
& Omit<NodeJS.ErrnoException, "code">
|
|
@@ -1154,80 +1124,44 @@ declare module "child_process" {
|
|
|
1154
1124
|
* @param args List of string arguments.
|
|
1155
1125
|
* @param callback Called with the output when process terminates.
|
|
1156
1126
|
*/
|
|
1157
|
-
function execFile(file: string): ChildProcess;
|
|
1158
|
-
function execFile(
|
|
1159
|
-
file: string,
|
|
1160
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1161
|
-
): ChildProcess;
|
|
1162
|
-
function execFile(file: string, args?: readonly string[] | null): ChildProcess;
|
|
1163
|
-
function execFile(
|
|
1164
|
-
file: string,
|
|
1165
|
-
args: readonly string[] | undefined | null,
|
|
1166
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1167
|
-
): ChildProcess;
|
|
1168
1127
|
// no `options` definitely means stdout/stderr are `string`.
|
|
1169
1128
|
function execFile(
|
|
1170
1129
|
file: string,
|
|
1171
|
-
callback
|
|
1130
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1172
1131
|
): ChildProcess;
|
|
1173
1132
|
function execFile(
|
|
1174
1133
|
file: string,
|
|
1175
1134
|
args: readonly string[] | undefined | null,
|
|
1176
|
-
callback
|
|
1135
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1177
1136
|
): ChildProcess;
|
|
1178
1137
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
1179
1138
|
function execFile(
|
|
1180
1139
|
file: string,
|
|
1181
1140
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1182
|
-
callback
|
|
1141
|
+
callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1183
1142
|
): ChildProcess;
|
|
1184
1143
|
function execFile(
|
|
1185
1144
|
file: string,
|
|
1186
1145
|
args: readonly string[] | undefined | null,
|
|
1187
1146
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1188
|
-
callback
|
|
1147
|
+
callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1189
1148
|
): ChildProcess;
|
|
1190
|
-
// `options` with well
|
|
1149
|
+
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1191
1150
|
function execFile(
|
|
1192
1151
|
file: string,
|
|
1193
1152
|
options: ExecFileOptionsWithStringEncoding,
|
|
1194
|
-
callback
|
|
1153
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1195
1154
|
): ChildProcess;
|
|
1196
1155
|
function execFile(
|
|
1197
1156
|
file: string,
|
|
1198
1157
|
args: readonly string[] | undefined | null,
|
|
1199
1158
|
options: ExecFileOptionsWithStringEncoding,
|
|
1200
|
-
callback
|
|
1201
|
-
): ChildProcess;
|
|
1202
|
-
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
|
|
1203
|
-
// There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
|
|
1204
|
-
function execFile(
|
|
1205
|
-
file: string,
|
|
1206
|
-
options: ExecFileOptionsWithOtherEncoding,
|
|
1207
|
-
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1208
|
-
): ChildProcess;
|
|
1209
|
-
function execFile(
|
|
1210
|
-
file: string,
|
|
1211
|
-
args: readonly string[] | undefined | null,
|
|
1212
|
-
options: ExecFileOptionsWithOtherEncoding,
|
|
1213
|
-
callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1214
|
-
): ChildProcess;
|
|
1215
|
-
// `options` without an `encoding` means stdout/stderr are definitely `string`.
|
|
1216
|
-
function execFile(
|
|
1217
|
-
file: string,
|
|
1218
|
-
options: ExecFileOptions,
|
|
1219
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1220
|
-
): ChildProcess;
|
|
1221
|
-
function execFile(
|
|
1222
|
-
file: string,
|
|
1223
|
-
args: readonly string[] | undefined | null,
|
|
1224
|
-
options: ExecFileOptions,
|
|
1225
|
-
callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1159
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1226
1160
|
): ChildProcess;
|
|
1227
1161
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
1228
1162
|
function execFile(
|
|
1229
1163
|
file: string,
|
|
1230
|
-
options:
|
|
1164
|
+
options: ExecFileOptions | undefined | null,
|
|
1231
1165
|
callback:
|
|
1232
1166
|
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1233
1167
|
| undefined
|
|
@@ -1236,7 +1170,7 @@ declare module "child_process" {
|
|
|
1236
1170
|
function execFile(
|
|
1237
1171
|
file: string,
|
|
1238
1172
|
args: readonly string[] | undefined | null,
|
|
1239
|
-
options:
|
|
1173
|
+
options: ExecFileOptions | undefined | null,
|
|
1240
1174
|
callback:
|
|
1241
1175
|
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1242
1176
|
| undefined
|
|
@@ -1286,37 +1220,7 @@ declare module "child_process" {
|
|
|
1286
1220
|
}>;
|
|
1287
1221
|
function __promisify__(
|
|
1288
1222
|
file: string,
|
|
1289
|
-
options:
|
|
1290
|
-
): PromiseWithChild<{
|
|
1291
|
-
stdout: string | Buffer;
|
|
1292
|
-
stderr: string | Buffer;
|
|
1293
|
-
}>;
|
|
1294
|
-
function __promisify__(
|
|
1295
|
-
file: string,
|
|
1296
|
-
args: readonly string[] | undefined | null,
|
|
1297
|
-
options: ExecFileOptionsWithOtherEncoding,
|
|
1298
|
-
): PromiseWithChild<{
|
|
1299
|
-
stdout: string | Buffer;
|
|
1300
|
-
stderr: string | Buffer;
|
|
1301
|
-
}>;
|
|
1302
|
-
function __promisify__(
|
|
1303
|
-
file: string,
|
|
1304
|
-
options: ExecFileOptions,
|
|
1305
|
-
): PromiseWithChild<{
|
|
1306
|
-
stdout: string;
|
|
1307
|
-
stderr: string;
|
|
1308
|
-
}>;
|
|
1309
|
-
function __promisify__(
|
|
1310
|
-
file: string,
|
|
1311
|
-
args: readonly string[] | undefined | null,
|
|
1312
|
-
options: ExecFileOptions,
|
|
1313
|
-
): PromiseWithChild<{
|
|
1314
|
-
stdout: string;
|
|
1315
|
-
stderr: string;
|
|
1316
|
-
}>;
|
|
1317
|
-
function __promisify__(
|
|
1318
|
-
file: string,
|
|
1319
|
-
options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
|
|
1223
|
+
options: ExecFileOptions | undefined | null,
|
|
1320
1224
|
): PromiseWithChild<{
|
|
1321
1225
|
stdout: string | Buffer;
|
|
1322
1226
|
stderr: string | Buffer;
|
|
@@ -1324,7 +1228,7 @@ declare module "child_process" {
|
|
|
1324
1228
|
function __promisify__(
|
|
1325
1229
|
file: string,
|
|
1326
1230
|
args: readonly string[] | undefined | null,
|
|
1327
|
-
options:
|
|
1231
|
+
options: ExecFileOptions | undefined | null,
|
|
1328
1232
|
): PromiseWithChild<{
|
|
1329
1233
|
stdout: string | Buffer;
|
|
1330
1234
|
stderr: string | Buffer;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// Polyfills for the explicit resource management types added in TypeScript 5.2.
|
|
2
|
-
// TODO: remove once this package no longer supports TS 5.1, and replace with a
|
|
3
|
-
// <reference> to TypeScript's disposable library in index.d.ts.
|
|
4
2
|
|
|
5
3
|
interface SymbolConstructor {
|
|
6
4
|
readonly dispose: unique symbol;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
// Polyfill for ES2022's .at() method on string/array prototypes, added to TypeScript in 4.6.
|
|
2
|
-
// TODO: these methods are not used within @types/node, and should be removed at the next
|
|
3
|
-
// major @types/node version; users should include the es2022 TypeScript libraries
|
|
4
|
-
// if they need these features.
|
|
5
2
|
|
|
6
3
|
interface RelativeIndexable<T> {
|
|
7
4
|
at(index: number): T | undefined;
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// are expected (eg. DOM-compatible APIs) if lib.esnext.iterator is loaded.
|
|
4
4
|
// Also ensures that iterators returned by the Node API, which inherit from Iterator.prototype, correctly expose the iterator helper methods
|
|
5
5
|
// if lib.esnext.iterator is loaded.
|
|
6
|
-
// TODO: remove once this package no longer supports TS 5.5, and replace NodeJS.BuiltinIteratorReturn with BuiltinIteratorReturn.
|
|
7
6
|
|
|
8
7
|
// Placeholders for TS <5.6
|
|
9
8
|
interface IteratorObject<T, TReturn, TNext> {}
|
|
@@ -3764,7 +3764,23 @@ declare module "crypto" {
|
|
|
3764
3764
|
*/
|
|
3765
3765
|
checkIP(ip: string): string | undefined;
|
|
3766
3766
|
/**
|
|
3767
|
-
* Checks whether this certificate was issued by the given `otherCert
|
|
3767
|
+
* Checks whether this certificate was potentially issued by the given `otherCert`
|
|
3768
|
+
* by comparing the certificate metadata.
|
|
3769
|
+
*
|
|
3770
|
+
* This is useful for pruning a list of possible issuer certificates which have been
|
|
3771
|
+
* selected using a more rudimentary filtering routine, i.e. just based on subject
|
|
3772
|
+
* and issuer names.
|
|
3773
|
+
*
|
|
3774
|
+
* Finally, to verify that this certificate's signature was produced by a private key
|
|
3775
|
+
* corresponding to `otherCert`'s public key use `x509.verify(publicKey)`
|
|
3776
|
+
* with `otherCert`'s public key represented as a `KeyObject`
|
|
3777
|
+
* like so
|
|
3778
|
+
*
|
|
3779
|
+
* ```js
|
|
3780
|
+
* if (!x509.verify(otherCert.publicKey)) {
|
|
3781
|
+
* throw new Error('otherCert did not issue x509');
|
|
3782
|
+
* }
|
|
3783
|
+
* ```
|
|
3768
3784
|
* @since v15.6.0
|
|
3769
3785
|
*/
|
|
3770
3786
|
checkIssued(otherCert: X509Certificate): boolean;
|
|
@@ -259,7 +259,7 @@ declare module "diagnostics_channel" {
|
|
|
259
259
|
* @param store The store to unbind from the channel.
|
|
260
260
|
* @return `true` if the store was found, `false` otherwise.
|
|
261
261
|
*/
|
|
262
|
-
unbindStore(store:
|
|
262
|
+
unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
|
|
263
263
|
/**
|
|
264
264
|
* Applies the given data to any AsyncLocalStorage instances bound to the channel
|
|
265
265
|
* for the duration of the given function, then publishes to the channel within
|
|
@@ -297,7 +297,12 @@ declare module "diagnostics_channel" {
|
|
|
297
297
|
* @param thisArg The receiver to be used for the function call.
|
|
298
298
|
* @param args Optional arguments to pass to the function.
|
|
299
299
|
*/
|
|
300
|
-
runStores(
|
|
300
|
+
runStores<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
301
|
+
context: ContextType,
|
|
302
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
303
|
+
thisArg?: ThisArg,
|
|
304
|
+
...args: Args
|
|
305
|
+
): Result;
|
|
301
306
|
}
|
|
302
307
|
interface TracingChannelSubscribers<ContextType extends object> {
|
|
303
308
|
start: (message: ContextType) => void;
|
|
@@ -441,12 +446,12 @@ declare module "diagnostics_channel" {
|
|
|
441
446
|
* @param args Optional arguments to pass to the function
|
|
442
447
|
* @return The return value of the given function
|
|
443
448
|
*/
|
|
444
|
-
traceSync<ThisArg = any, Args extends any[] = any[]>(
|
|
445
|
-
fn: (this: ThisArg, ...args: Args) =>
|
|
449
|
+
traceSync<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
450
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
446
451
|
context?: ContextType,
|
|
447
452
|
thisArg?: ThisArg,
|
|
448
453
|
...args: Args
|
|
449
|
-
):
|
|
454
|
+
): Result;
|
|
450
455
|
/**
|
|
451
456
|
* Trace a promise-returning function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
|
452
457
|
* function execution, and will produce an `asyncStart event` and `asyncEnd event` when a promise continuation is reached. It may also
|
|
@@ -476,12 +481,12 @@ declare module "diagnostics_channel" {
|
|
|
476
481
|
* @param args Optional arguments to pass to the function
|
|
477
482
|
* @return Chained from promise returned by the given function
|
|
478
483
|
*/
|
|
479
|
-
tracePromise<ThisArg = any, Args extends any[] = any[]>(
|
|
480
|
-
fn: (this: ThisArg, ...args: Args) => Promise<
|
|
484
|
+
tracePromise<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
485
|
+
fn: (this: ThisArg, ...args: Args) => Promise<Result>,
|
|
481
486
|
context?: ContextType,
|
|
482
487
|
thisArg?: ThisArg,
|
|
483
488
|
...args: Args
|
|
484
|
-
):
|
|
489
|
+
): Promise<Result>;
|
|
485
490
|
/**
|
|
486
491
|
* Trace a callback-receiving function call. This will always produce a `start event` and `end event` around the synchronous portion of the
|
|
487
492
|
* function execution, and will produce a `asyncStart event` and `asyncEnd event` around the callback execution. It may also produce an `error event` if the given function throws an error or
|
|
@@ -540,13 +545,13 @@ declare module "diagnostics_channel" {
|
|
|
540
545
|
* @param args Optional arguments to pass to the function
|
|
541
546
|
* @return The return value of the given function
|
|
542
547
|
*/
|
|
543
|
-
traceCallback<
|
|
544
|
-
fn:
|
|
548
|
+
traceCallback<ThisArg = any, Args extends any[] = any[], Result = any>(
|
|
549
|
+
fn: (this: ThisArg, ...args: Args) => Result,
|
|
545
550
|
position?: number,
|
|
546
551
|
context?: ContextType,
|
|
547
|
-
thisArg?:
|
|
548
|
-
...args:
|
|
549
|
-
):
|
|
552
|
+
thisArg?: ThisArg,
|
|
553
|
+
...args: Args
|
|
554
|
+
): Result;
|
|
550
555
|
/**
|
|
551
556
|
* `true` if any of the individual channels has a subscriber, `false` if not.
|
|
552
557
|
*
|
|
@@ -20,6 +20,7 @@ declare module "dns/promises" {
|
|
|
20
20
|
ResolveWithTtlOptions,
|
|
21
21
|
SoaRecord,
|
|
22
22
|
SrvRecord,
|
|
23
|
+
TlsaRecord,
|
|
23
24
|
} from "node:dns";
|
|
24
25
|
/**
|
|
25
26
|
* Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
|
|
@@ -126,22 +127,26 @@ declare module "dns/promises" {
|
|
|
126
127
|
* @param [rrtype='A'] Resource record type.
|
|
127
128
|
*/
|
|
128
129
|
function resolve(hostname: string): Promise<string[]>;
|
|
129
|
-
function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
|
|
130
|
-
function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
|
|
130
|
+
function resolve(hostname: string, rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
|
|
131
131
|
function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
|
|
132
132
|
function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
|
|
133
|
-
function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
|
|
134
133
|
function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
|
|
135
134
|
function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
|
|
136
|
-
function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
|
|
137
|
-
function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
|
|
138
135
|
function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
|
|
139
136
|
function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
|
|
137
|
+
function resolve(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
|
|
140
138
|
function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
|
|
141
|
-
function resolve(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
function resolve(hostname: string, rrtype: string): Promise<
|
|
140
|
+
| string[]
|
|
141
|
+
| CaaRecord[]
|
|
142
|
+
| MxRecord[]
|
|
143
|
+
| NaptrRecord[]
|
|
144
|
+
| SoaRecord
|
|
145
|
+
| SrvRecord[]
|
|
146
|
+
| TlsaRecord[]
|
|
147
|
+
| string[][]
|
|
148
|
+
| AnyRecord[]
|
|
149
|
+
>;
|
|
145
150
|
/**
|
|
146
151
|
* Uses the DNS protocol to resolve IPv4 addresses (`A` records) for the `hostname`. On success, the `Promise` is resolved with an array of IPv4
|
|
147
152
|
* addresses (e.g. `['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
|
|
@@ -292,6 +297,27 @@ declare module "dns/promises" {
|
|
|
292
297
|
* @since v10.6.0
|
|
293
298
|
*/
|
|
294
299
|
function resolveSrv(hostname: string): Promise<SrvRecord[]>;
|
|
300
|
+
/**
|
|
301
|
+
* Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
|
|
302
|
+
* the `hostname`. On success, the `Promise` is resolved with an array of objectsAdd commentMore actions
|
|
303
|
+
* with these properties:
|
|
304
|
+
*
|
|
305
|
+
* * `certUsage`
|
|
306
|
+
* * `selector`
|
|
307
|
+
* * `match`
|
|
308
|
+
* * `data`
|
|
309
|
+
*
|
|
310
|
+
* ```js
|
|
311
|
+
* {
|
|
312
|
+
* certUsage: 3,
|
|
313
|
+
* selector: 1,
|
|
314
|
+
* match: 1,
|
|
315
|
+
* data: [ArrayBuffer]
|
|
316
|
+
* }
|
|
317
|
+
* ```
|
|
318
|
+
* @since v22.15.0
|
|
319
|
+
*/
|
|
320
|
+
function resolveTlsa(hostname: string): Promise<TlsaRecord[]>;
|
|
295
321
|
/**
|
|
296
322
|
* Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. On success, the `Promise` is resolved with a two-dimensional array
|
|
297
323
|
* of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
|
|
@@ -450,6 +476,7 @@ declare module "dns/promises" {
|
|
|
450
476
|
resolvePtr: typeof resolvePtr;
|
|
451
477
|
resolveSoa: typeof resolveSoa;
|
|
452
478
|
resolveSrv: typeof resolveSrv;
|
|
479
|
+
resolveTlsa: typeof resolveTlsa;
|
|
453
480
|
resolveTxt: typeof resolveTxt;
|
|
454
481
|
reverse: typeof reverse;
|
|
455
482
|
/**
|