@types/node 22.15.21 → 22.18.10
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 +41 -131
- node/cluster.d.ts → node v22.18/cluster.d.ts +3 -4
- 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 +52 -36
- node/diagnostics_channel.d.ts → node v22.18/diagnostics_channel.d.ts +17 -12
- node/dns/promises.d.ts → node v22.18/dns/promises.d.ts +36 -9
- node/dns.d.ts → node v22.18/dns.d.ts +74 -21
- node/events.d.ts → node v22.18/events.d.ts +80 -35
- node/fs/promises.d.ts → node v22.18/fs/promises.d.ts +44 -39
- node/fs.d.ts → node v22.18/fs.d.ts +67 -56
- node v22.18/globals.d.ts +172 -0
- node/http.d.ts → node v22.18/http.d.ts +71 -10
- node/http2.d.ts → node v22.18/http2.d.ts +85 -5
- node/https.d.ts → node v22.18/https.d.ts +14 -12
- 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 +5 -5
- node/os.d.ts → node v22.18/os.d.ts +13 -3
- node/package.json → node v22.18/package.json +3 -83
- node/perf_hooks.d.ts → node v22.18/perf_hooks.d.ts +8 -10
- node/process.d.ts → node v22.18/process.d.ts +10 -23
- node/readline/promises.d.ts → node v22.18/readline/promises.d.ts +1 -2
- 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 +34 -32
- node v22.18/test.d.ts +2162 -0
- node/tls.d.ts → node v22.18/tls.d.ts +2 -2
- 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 +62 -32
- node/vm.d.ts → node v22.18/vm.d.ts +62 -54
- 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}/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}/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}/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: Sat, 11 Oct 2025 14:02:18 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,11 +66,10 @@
|
|
|
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";
|
|
73
|
-
import {
|
|
72
|
+
import { Readable, Stream, Writable } from "node:stream";
|
|
74
73
|
import { URL } from "node:url";
|
|
75
74
|
type Serializable = string | object | number | boolean | bigint;
|
|
76
75
|
type SendHandle = net.Socket | net.Server | dgram.Socket | undefined;
|
|
@@ -140,7 +139,7 @@ declare module "child_process" {
|
|
|
140
139
|
* no IPC channel exists, this property is `undefined`.
|
|
141
140
|
* @since v7.1.0
|
|
142
141
|
*/
|
|
143
|
-
readonly channel?:
|
|
142
|
+
readonly channel?: Control | null;
|
|
144
143
|
/**
|
|
145
144
|
* A sparse array of pipes to the child process, corresponding with positions in
|
|
146
145
|
* the `stdio` option passed to {@link spawn} that have been set
|
|
@@ -613,6 +612,10 @@ declare module "child_process" {
|
|
|
613
612
|
Readable | Writable | null | undefined, // extra, no modification
|
|
614
613
|
];
|
|
615
614
|
}
|
|
615
|
+
interface Control extends EventEmitter {
|
|
616
|
+
ref(): void;
|
|
617
|
+
unref(): void;
|
|
618
|
+
}
|
|
616
619
|
interface MessageOptions {
|
|
617
620
|
keepOpen?: boolean | undefined;
|
|
618
621
|
}
|
|
@@ -887,18 +890,20 @@ declare module "child_process" {
|
|
|
887
890
|
signal?: AbortSignal | undefined;
|
|
888
891
|
maxBuffer?: number | undefined;
|
|
889
892
|
killSignal?: NodeJS.Signals | number | undefined;
|
|
893
|
+
encoding?: string | null | undefined;
|
|
890
894
|
}
|
|
891
895
|
interface ExecOptionsWithStringEncoding extends ExecOptions {
|
|
892
|
-
encoding
|
|
896
|
+
encoding?: BufferEncoding | undefined;
|
|
893
897
|
}
|
|
894
898
|
interface ExecOptionsWithBufferEncoding extends ExecOptions {
|
|
895
|
-
encoding:
|
|
899
|
+
encoding: "buffer" | null; // specify `null`.
|
|
896
900
|
}
|
|
901
|
+
// TODO: Just Plain Wrong™ (see also nodejs/node#57392)
|
|
897
902
|
interface ExecException extends Error {
|
|
898
|
-
cmd?: string
|
|
899
|
-
killed?: boolean
|
|
900
|
-
code?: number
|
|
901
|
-
signal?: NodeJS.Signals
|
|
903
|
+
cmd?: string;
|
|
904
|
+
killed?: boolean;
|
|
905
|
+
code?: number;
|
|
906
|
+
signal?: NodeJS.Signals;
|
|
902
907
|
stdout?: string;
|
|
903
908
|
stderr?: string;
|
|
904
909
|
}
|
|
@@ -995,38 +1000,19 @@ declare module "child_process" {
|
|
|
995
1000
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
996
1001
|
function exec(
|
|
997
1002
|
command: string,
|
|
998
|
-
options:
|
|
999
|
-
encoding: "buffer" | null;
|
|
1000
|
-
} & ExecOptions,
|
|
1003
|
+
options: ExecOptionsWithBufferEncoding,
|
|
1001
1004
|
callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1002
1005
|
): ChildProcess;
|
|
1003
|
-
// `options` with well
|
|
1006
|
+
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1004
1007
|
function exec(
|
|
1005
1008
|
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`.
|
|
1021
|
-
function exec(
|
|
1022
|
-
command: string,
|
|
1023
|
-
options: ExecOptions,
|
|
1009
|
+
options: ExecOptionsWithStringEncoding,
|
|
1024
1010
|
callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
|
|
1025
1011
|
): ChildProcess;
|
|
1026
1012
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
1027
1013
|
function exec(
|
|
1028
1014
|
command: string,
|
|
1029
|
-
options:
|
|
1015
|
+
options: ExecOptions | undefined | null,
|
|
1030
1016
|
callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
|
|
1031
1017
|
): ChildProcess;
|
|
1032
1018
|
interface PromiseWithChild<T> extends Promise<T> {
|
|
@@ -1039,32 +1025,21 @@ declare module "child_process" {
|
|
|
1039
1025
|
}>;
|
|
1040
1026
|
function __promisify__(
|
|
1041
1027
|
command: string,
|
|
1042
|
-
options:
|
|
1043
|
-
encoding: "buffer" | null;
|
|
1044
|
-
} & ExecOptions,
|
|
1028
|
+
options: ExecOptionsWithBufferEncoding,
|
|
1045
1029
|
): PromiseWithChild<{
|
|
1046
1030
|
stdout: Buffer;
|
|
1047
1031
|
stderr: Buffer;
|
|
1048
1032
|
}>;
|
|
1049
1033
|
function __promisify__(
|
|
1050
1034
|
command: string,
|
|
1051
|
-
options:
|
|
1052
|
-
encoding: BufferEncoding;
|
|
1053
|
-
} & ExecOptions,
|
|
1054
|
-
): PromiseWithChild<{
|
|
1055
|
-
stdout: string;
|
|
1056
|
-
stderr: string;
|
|
1057
|
-
}>;
|
|
1058
|
-
function __promisify__(
|
|
1059
|
-
command: string,
|
|
1060
|
-
options: ExecOptions,
|
|
1035
|
+
options: ExecOptionsWithStringEncoding,
|
|
1061
1036
|
): PromiseWithChild<{
|
|
1062
1037
|
stdout: string;
|
|
1063
1038
|
stderr: string;
|
|
1064
1039
|
}>;
|
|
1065
1040
|
function __promisify__(
|
|
1066
1041
|
command: string,
|
|
1067
|
-
options
|
|
1042
|
+
options: ExecOptions | undefined | null,
|
|
1068
1043
|
): PromiseWithChild<{
|
|
1069
1044
|
stdout: string | Buffer;
|
|
1070
1045
|
stderr: string | Buffer;
|
|
@@ -1076,20 +1051,21 @@ declare module "child_process" {
|
|
|
1076
1051
|
windowsVerbatimArguments?: boolean | undefined;
|
|
1077
1052
|
shell?: boolean | string | undefined;
|
|
1078
1053
|
signal?: AbortSignal | undefined;
|
|
1054
|
+
encoding?: string | null | undefined;
|
|
1079
1055
|
}
|
|
1080
1056
|
interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
|
|
1081
|
-
encoding
|
|
1057
|
+
encoding?: BufferEncoding | undefined;
|
|
1082
1058
|
}
|
|
1083
1059
|
interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
|
|
1084
1060
|
encoding: "buffer" | null;
|
|
1085
1061
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1062
|
+
/** @deprecated Use `ExecFileOptions` instead. */
|
|
1063
|
+
interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {}
|
|
1064
|
+
// TODO: execFile exceptions can take many forms... this accurately describes none of them
|
|
1089
1065
|
type ExecFileException =
|
|
1090
1066
|
& Omit<ExecException, "code">
|
|
1091
1067
|
& Omit<NodeJS.ErrnoException, "code">
|
|
1092
|
-
& { code?: string | number |
|
|
1068
|
+
& { code?: string | number | null };
|
|
1093
1069
|
/**
|
|
1094
1070
|
* The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
|
|
1095
1071
|
* executable `file` is spawned directly as a new process making it slightly more
|
|
@@ -1154,80 +1130,44 @@ declare module "child_process" {
|
|
|
1154
1130
|
* @param args List of string arguments.
|
|
1155
1131
|
* @param callback Called with the output when process terminates.
|
|
1156
1132
|
*/
|
|
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
1133
|
// no `options` definitely means stdout/stderr are `string`.
|
|
1169
1134
|
function execFile(
|
|
1170
1135
|
file: string,
|
|
1171
|
-
callback
|
|
1136
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1172
1137
|
): ChildProcess;
|
|
1173
1138
|
function execFile(
|
|
1174
1139
|
file: string,
|
|
1175
1140
|
args: readonly string[] | undefined | null,
|
|
1176
|
-
callback
|
|
1141
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1177
1142
|
): ChildProcess;
|
|
1178
1143
|
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
|
|
1179
1144
|
function execFile(
|
|
1180
1145
|
file: string,
|
|
1181
1146
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1182
|
-
callback
|
|
1147
|
+
callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1183
1148
|
): ChildProcess;
|
|
1184
1149
|
function execFile(
|
|
1185
1150
|
file: string,
|
|
1186
1151
|
args: readonly string[] | undefined | null,
|
|
1187
1152
|
options: ExecFileOptionsWithBufferEncoding,
|
|
1188
|
-
callback
|
|
1153
|
+
callback?: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
|
|
1189
1154
|
): ChildProcess;
|
|
1190
|
-
// `options` with well
|
|
1155
|
+
// `options` with well-known or absent `encoding` means stdout/stderr are definitely `string`.
|
|
1191
1156
|
function execFile(
|
|
1192
1157
|
file: string,
|
|
1193
1158
|
options: ExecFileOptionsWithStringEncoding,
|
|
1194
|
-
callback
|
|
1159
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1195
1160
|
): ChildProcess;
|
|
1196
1161
|
function execFile(
|
|
1197
1162
|
file: string,
|
|
1198
1163
|
args: readonly string[] | undefined | null,
|
|
1199
1164
|
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,
|
|
1165
|
+
callback?: (error: ExecFileException | null, stdout: string, stderr: string) => void,
|
|
1226
1166
|
): ChildProcess;
|
|
1227
1167
|
// fallback if nothing else matches. Worst case is always `string | Buffer`.
|
|
1228
1168
|
function execFile(
|
|
1229
1169
|
file: string,
|
|
1230
|
-
options:
|
|
1170
|
+
options: ExecFileOptions | undefined | null,
|
|
1231
1171
|
callback:
|
|
1232
1172
|
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1233
1173
|
| undefined
|
|
@@ -1236,7 +1176,7 @@ declare module "child_process" {
|
|
|
1236
1176
|
function execFile(
|
|
1237
1177
|
file: string,
|
|
1238
1178
|
args: readonly string[] | undefined | null,
|
|
1239
|
-
options:
|
|
1179
|
+
options: ExecFileOptions | undefined | null,
|
|
1240
1180
|
callback:
|
|
1241
1181
|
| ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
|
|
1242
1182
|
| undefined
|
|
@@ -1286,37 +1226,7 @@ declare module "child_process" {
|
|
|
1286
1226
|
}>;
|
|
1287
1227
|
function __promisify__(
|
|
1288
1228
|
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,
|
|
1229
|
+
options: ExecFileOptions | undefined | null,
|
|
1320
1230
|
): PromiseWithChild<{
|
|
1321
1231
|
stdout: string | Buffer;
|
|
1322
1232
|
stderr: string | Buffer;
|
|
@@ -1324,7 +1234,7 @@ declare module "child_process" {
|
|
|
1324
1234
|
function __promisify__(
|
|
1325
1235
|
file: string,
|
|
1326
1236
|
args: readonly string[] | undefined | null,
|
|
1327
|
-
options:
|
|
1237
|
+
options: ExecFileOptions | undefined | null,
|
|
1328
1238
|
): PromiseWithChild<{
|
|
1329
1239
|
stdout: string | Buffer;
|
|
1330
1240
|
stderr: string | Buffer;
|
|
@@ -1416,7 +1326,7 @@ declare module "child_process" {
|
|
|
1416
1326
|
stderr: T;
|
|
1417
1327
|
status: number | null;
|
|
1418
1328
|
signal: NodeJS.Signals | null;
|
|
1419
|
-
error?: Error
|
|
1329
|
+
error?: Error;
|
|
1420
1330
|
}
|
|
1421
1331
|
/**
|
|
1422
1332
|
* The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
|
|
@@ -1505,7 +1415,7 @@ declare module "child_process" {
|
|
|
1505
1415
|
encoding: BufferEncoding;
|
|
1506
1416
|
}
|
|
1507
1417
|
interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
|
|
1508
|
-
encoding?: "buffer" | null; // specify `null`.
|
|
1418
|
+
encoding?: "buffer" | null | undefined; // specify `null`.
|
|
1509
1419
|
}
|
|
1510
1420
|
/**
|
|
1511
1421
|
* The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
|
|
@@ -481,7 +481,7 @@ declare module "cluster" {
|
|
|
481
481
|
* ```
|
|
482
482
|
* @since v0.7.0
|
|
483
483
|
*/
|
|
484
|
-
readonly worker?: Worker
|
|
484
|
+
readonly worker?: Worker;
|
|
485
485
|
/**
|
|
486
486
|
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
|
487
487
|
*
|
|
@@ -497,7 +497,7 @@ declare module "cluster" {
|
|
|
497
497
|
* ```
|
|
498
498
|
* @since v0.7.0
|
|
499
499
|
*/
|
|
500
|
-
readonly workers?: NodeJS.Dict<Worker
|
|
500
|
+
readonly workers?: NodeJS.Dict<Worker>;
|
|
501
501
|
readonly SCHED_NONE: number;
|
|
502
502
|
readonly SCHED_RR: number;
|
|
503
503
|
/**
|
|
@@ -550,10 +550,9 @@ declare module "cluster" {
|
|
|
550
550
|
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
|
551
551
|
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
|
552
552
|
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
|
553
|
-
// the handle is a net.Socket or net.Server object, or undefined.
|
|
554
553
|
prependListener(
|
|
555
554
|
event: "message",
|
|
556
|
-
listener: (worker: Worker, message: any, handle
|
|
555
|
+
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
|
557
556
|
): this;
|
|
558
557
|
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
|
559
558
|
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
|
@@ -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> {}
|