@types/node 14.18.62 → 14.18.63

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.
Files changed (84) hide show
  1. node v14.18/README.md +1 -1
  2. node v14.18/assert.d.ts +33 -31
  3. node v14.18/async_hooks.d.ts +27 -20
  4. node v14.18/buffer.d.ts +4 -4
  5. node v14.18/child_process.d.ts +191 -62
  6. node v14.18/cluster.d.ts +59 -28
  7. node v14.18/console.d.ts +6 -6
  8. node v14.18/constants.d.ts +12 -11
  9. node v14.18/crypto.d.ts +232 -228
  10. node v14.18/dgram.d.ts +50 -14
  11. node v14.18/dns.d.ts +183 -54
  12. node v14.18/domain.d.ts +4 -4
  13. node v14.18/events.d.ts +4 -4
  14. node v14.18/fs/promises.d.ts +87 -25
  15. node v14.18/fs.d.ts +404 -104
  16. node v14.18/globals.d.ts +33 -16
  17. node v14.18/http.d.ts +201 -201
  18. node v14.18/http2.d.ts +340 -93
  19. node v14.18/https.d.ts +107 -105
  20. node v14.18/module.d.ts +4 -4
  21. node v14.18/net.d.ts +27 -12
  22. node v14.18/os.d.ts +4 -4
  23. node v14.18/package.json +2 -2
  24. node v14.18/path.d.ts +5 -5
  25. node v14.18/perf_hooks.d.ts +5 -5
  26. node v14.18/process.d.ts +61 -22
  27. node v14.18/punycode.d.ts +3 -3
  28. node v14.18/querystring.d.ts +15 -5
  29. node v14.18/readline.d.ts +16 -6
  30. node v14.18/repl.d.ts +13 -7
  31. node v14.18/stream.d.ts +160 -100
  32. node v14.18/string_decoder.d.ts +3 -3
  33. node v14.18/timers.d.ts +3 -3
  34. node v14.18/tls.d.ts +109 -27
  35. node v14.18/trace_events.d.ts +3 -3
  36. node v14.18/ts4.8/assert.d.ts +33 -31
  37. node v14.18/ts4.8/async_hooks.d.ts +27 -20
  38. node v14.18/ts4.8/buffer.d.ts +4 -4
  39. node v14.18/ts4.8/child_process.d.ts +191 -62
  40. node v14.18/ts4.8/cluster.d.ts +59 -28
  41. node v14.18/ts4.8/console.d.ts +6 -6
  42. node v14.18/ts4.8/constants.d.ts +12 -11
  43. node v14.18/ts4.8/crypto.d.ts +232 -228
  44. node v14.18/ts4.8/dgram.d.ts +50 -14
  45. node v14.18/ts4.8/dns.d.ts +183 -54
  46. node v14.18/ts4.8/domain.d.ts +4 -4
  47. node v14.18/ts4.8/events.d.ts +4 -4
  48. node v14.18/ts4.8/fs/promises.d.ts +87 -25
  49. node v14.18/ts4.8/fs.d.ts +404 -104
  50. node v14.18/ts4.8/globals.d.ts +33 -16
  51. node v14.18/ts4.8/http.d.ts +200 -200
  52. node v14.18/ts4.8/http2.d.ts +340 -93
  53. node v14.18/ts4.8/https.d.ts +107 -105
  54. node v14.18/ts4.8/module.d.ts +4 -4
  55. node v14.18/ts4.8/net.d.ts +27 -12
  56. node v14.18/ts4.8/os.d.ts +4 -4
  57. node v14.18/ts4.8/path.d.ts +5 -5
  58. node v14.18/ts4.8/perf_hooks.d.ts +5 -5
  59. node v14.18/ts4.8/process.d.ts +61 -22
  60. node v14.18/ts4.8/punycode.d.ts +3 -3
  61. node v14.18/ts4.8/querystring.d.ts +15 -5
  62. node v14.18/ts4.8/readline.d.ts +16 -6
  63. node v14.18/ts4.8/repl.d.ts +13 -7
  64. node v14.18/ts4.8/stream.d.ts +160 -100
  65. node v14.18/ts4.8/string_decoder.d.ts +3 -3
  66. node v14.18/ts4.8/timers.d.ts +3 -3
  67. node v14.18/ts4.8/tls.d.ts +109 -27
  68. node v14.18/ts4.8/trace_events.d.ts +3 -3
  69. node v14.18/ts4.8/tty.d.ts +4 -4
  70. node v14.18/ts4.8/url.d.ts +21 -12
  71. node v14.18/ts4.8/util.d.ts +102 -40
  72. node v14.18/ts4.8/v8.d.ts +4 -5
  73. node v14.18/ts4.8/vm.d.ts +7 -7
  74. node v14.18/ts4.8/wasi.d.ts +3 -4
  75. node v14.18/ts4.8/worker_threads.d.ts +8 -8
  76. node v14.18/ts4.8/zlib.d.ts +13 -13
  77. node v14.18/tty.d.ts +4 -4
  78. node v14.18/url.d.ts +21 -12
  79. node v14.18/util.d.ts +102 -40
  80. node v14.18/v8.d.ts +4 -5
  81. node v14.18/vm.d.ts +7 -7
  82. node v14.18/wasi.d.ts +3 -4
  83. node v14.18/worker_threads.d.ts +8 -8
  84. node v14.18/zlib.d.ts +13 -13
node v14.18/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 20 Sep 2023 03:06:41 GMT
11
+ * Last updated: Sat, 23 Sep 2023 20:38:33 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node v14.18/assert.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module 'assert' {
1
+ declare module "assert" {
2
2
  /** An alias of `assert.ok()`. */
3
3
  function assert(value: any, message?: string | Error): asserts value;
4
4
  namespace assert {
@@ -7,7 +7,7 @@ declare module 'assert' {
7
7
  expected: any;
8
8
  operator: string;
9
9
  generatedMessage: boolean;
10
- code: 'ERR_ASSERTION';
10
+ code: "ERR_ASSERTION";
11
11
 
12
12
  constructor(options?: {
13
13
  /** If provided, the error message is set to this value. */
@@ -42,7 +42,7 @@ declare module 'assert' {
42
42
  stack: object;
43
43
  }
44
44
 
45
- type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
45
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
46
46
 
47
47
  function fail(message?: string | Error): never;
48
48
  /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
@@ -91,38 +91,40 @@ declare module 'assert' {
91
91
  function match(value: string, regExp: RegExp, message?: string | Error): void;
92
92
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93
93
 
94
- const strict: Omit<
95
- typeof assert,
96
- | 'equal'
97
- | 'notEqual'
98
- | 'deepEqual'
99
- | 'notDeepEqual'
100
- | 'ok'
101
- | 'strictEqual'
102
- | 'deepStrictEqual'
103
- | 'ifError'
104
- | 'strict'
105
- > & {
106
- (value: any, message?: string | Error): asserts value;
107
- equal: typeof strictEqual;
108
- notEqual: typeof notStrictEqual;
109
- deepEqual: typeof deepStrictEqual;
110
- notDeepEqual: typeof notDeepStrictEqual;
94
+ const strict:
95
+ & Omit<
96
+ typeof assert,
97
+ | "equal"
98
+ | "notEqual"
99
+ | "deepEqual"
100
+ | "notDeepEqual"
101
+ | "ok"
102
+ | "strictEqual"
103
+ | "deepStrictEqual"
104
+ | "ifError"
105
+ | "strict"
106
+ >
107
+ & {
108
+ (value: any, message?: string | Error): asserts value;
109
+ equal: typeof strictEqual;
110
+ notEqual: typeof notStrictEqual;
111
+ deepEqual: typeof deepStrictEqual;
112
+ notDeepEqual: typeof notDeepStrictEqual;
111
113
 
112
- // Mapped types and assertion functions are incompatible?
113
- // TS2775: Assertions require every name in the call target
114
- // to be declared with an explicit type annotation.
115
- ok: typeof ok;
116
- strictEqual: typeof strictEqual;
117
- deepStrictEqual: typeof deepStrictEqual;
118
- ifError: typeof ifError;
119
- strict: typeof strict;
120
- };
114
+ // Mapped types and assertion functions are incompatible?
115
+ // TS2775: Assertions require every name in the call target
116
+ // to be declared with an explicit type annotation.
117
+ ok: typeof ok;
118
+ strictEqual: typeof strictEqual;
119
+ deepStrictEqual: typeof deepStrictEqual;
120
+ ifError: typeof ifError;
121
+ strict: typeof strict;
122
+ };
121
123
  }
122
124
 
123
125
  export = assert;
124
126
  }
125
- declare module 'node:assert' {
126
- import assert = require('assert');
127
+ declare module "node:assert" {
128
+ import assert = require("assert");
127
129
  export = assert;
128
130
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Async Hooks module: https://nodejs.org/api/async_hooks.html
3
3
  */
4
- declare module 'async_hooks' {
4
+ declare module "async_hooks" {
5
5
  /**
6
6
  * Returns the asyncId of the current execution context.
7
7
  */
@@ -83,20 +83,20 @@ declare module 'async_hooks' {
83
83
  function createHook(options: HookCallbacks): AsyncHook;
84
84
 
85
85
  interface AsyncResourceOptions {
86
- /**
87
- * The ID of the execution context that created this async event.
88
- * @default executionAsyncId()
89
- */
90
- triggerAsyncId?: number | undefined;
91
-
92
- /**
93
- * Disables automatic `emitDestroy` when the object is garbage collected.
94
- * This usually does not need to be set (even if `emitDestroy` is called
95
- * manually), unless the resource's `asyncId` is retrieved and the
96
- * sensitive API's `emitDestroy` is called with it.
97
- * @default false
98
- */
99
- requireManualDestroy?: boolean | undefined;
86
+ /**
87
+ * The ID of the execution context that created this async event.
88
+ * @default executionAsyncId()
89
+ */
90
+ triggerAsyncId?: number | undefined;
91
+
92
+ /**
93
+ * Disables automatic `emitDestroy` when the object is garbage collected.
94
+ * This usually does not need to be set (even if `emitDestroy` is called
95
+ * manually), unless the resource's `asyncId` is retrieved and the
96
+ * sensitive API's `emitDestroy` is called with it.
97
+ * @default false
98
+ */
99
+ requireManualDestroy?: boolean | undefined;
100
100
  }
101
101
 
102
102
  /**
@@ -113,14 +113,17 @@ declare module 'async_hooks' {
113
113
  * this async event (default: `executionAsyncId()`), or an
114
114
  * AsyncResourceOptions object (since v9.3.0)
115
115
  */
116
- constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
116
+ constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
117
117
 
118
118
  /**
119
119
  * Binds the given function to the current execution context.
120
120
  * @param fn The function to bind to the current execution context.
121
121
  * @param type An optional name to associate with the underlying `AsyncResource`.
122
122
  */
123
- static bind<Func extends (...args: any[]) => any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
123
+ static bind<Func extends (...args: any[]) => any>(
124
+ fn: Func,
125
+ type?: string,
126
+ ): Func & { asyncResource: AsyncResource };
124
127
 
125
128
  /**
126
129
  * Binds the given function to execute to this `AsyncResource`'s scope.
@@ -139,7 +142,11 @@ declare module 'async_hooks' {
139
142
  * @param thisArg The receiver to be used for the function call.
140
143
  * @param args Optional arguments to pass to the function.
141
144
  */
142
- runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
145
+ runInAsyncScope<This, Result>(
146
+ fn: (this: This, ...args: any[]) => Result,
147
+ thisArg?: This,
148
+ ...args: any[]
149
+ ): Result;
143
150
 
144
151
  /**
145
152
  * Call AsyncHooks destroy callbacks.
@@ -225,6 +232,6 @@ declare module 'async_hooks' {
225
232
  enterWith(store: T): void;
226
233
  }
227
234
  }
228
- declare module 'node:async_hooks' {
229
- export * from 'async_hooks';
235
+ declare module "node:async_hooks" {
236
+ export * from "async_hooks";
230
237
  }
node v14.18/buffer.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- declare module 'buffer' {
2
- import { BinaryLike } from 'node:crypto';
1
+ declare module "buffer" {
2
+ import { BinaryLike } from "node:crypto";
3
3
  export const INSPECT_MAX_BYTES: number;
4
4
  export const kMaxLength: number;
5
5
  export const kStringMaxLength: number;
@@ -84,6 +84,6 @@ declare module 'buffer' {
84
84
 
85
85
  export { BuffType as Buffer };
86
86
  }
87
- declare module 'node:buffer' {
88
- export * from 'buffer';
87
+ declare module "node:buffer" {
88
+ export * from "buffer";
89
89
  }
@@ -1,8 +1,8 @@
1
- declare module 'child_process' {
2
- import { BaseEncodingOptions } from 'fs';
3
- import * as events from 'events';
4
- import * as net from 'net';
5
- import { Writable, Readable, Stream, Pipe } from 'stream';
1
+ declare module "child_process" {
2
+ import { BaseEncodingOptions } from "fs";
3
+ import * as events from "events";
4
+ import * as net from "net";
5
+ import { Pipe, Readable, Stream, Writable } from "stream";
6
6
 
7
7
  type Serializable = string | object | number | boolean;
8
8
  type SendHandle = net.Socket | net.Server;
@@ -17,7 +17,7 @@ declare module 'child_process' {
17
17
  Readable | null, // stdout
18
18
  Readable | null, // stderr
19
19
  Readable | Writable | null | undefined, // extra
20
- Readable | Writable | null | undefined // extra
20
+ Readable | Writable | null | undefined, // extra
21
21
  ];
22
22
  readonly killed: boolean;
23
23
  readonly pid: number;
@@ -29,7 +29,12 @@ declare module 'child_process' {
29
29
  kill(signal?: NodeJS.Signals | number): boolean;
30
30
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
31
31
  send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
32
- send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
32
+ send(
33
+ message: Serializable,
34
+ sendHandle?: SendHandle,
35
+ options?: MessageOptions,
36
+ callback?: (error: Error | null) => void,
37
+ ): boolean;
33
38
  disconnect(): void;
34
39
  unref(): void;
35
40
  ref(): void;
@@ -79,10 +84,16 @@ declare module 'child_process' {
79
84
  prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
80
85
 
81
86
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
82
- prependOnceListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
87
+ prependOnceListener(
88
+ event: "close",
89
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
90
+ ): this;
83
91
  prependOnceListener(event: "disconnect", listener: () => void): this;
84
92
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
85
- prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
93
+ prependOnceListener(
94
+ event: "exit",
95
+ listener: (code: number | null, signal: NodeJS.Signals | null) => void,
96
+ ): this;
86
97
  prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
87
98
  }
88
99
 
@@ -96,7 +107,7 @@ declare module 'child_process' {
96
107
  Readable, // stdout
97
108
  Readable, // stderr
98
109
  Readable | Writable | null | undefined, // extra, no modification
99
- Readable | Writable | null | undefined // extra, no modification
110
+ Readable | Writable | null | undefined, // extra, no modification
100
111
  ];
101
112
  }
102
113
 
@@ -114,7 +125,7 @@ declare module 'child_process' {
114
125
  O,
115
126
  E,
116
127
  Readable | Writable | null | undefined, // extra, no modification
117
- Readable | Writable | null | undefined // extra, no modification
128
+ Readable | Writable | null | undefined, // extra, no modification
118
129
  ];
119
130
  }
120
131
 
@@ -122,9 +133,13 @@ declare module 'child_process' {
122
133
  keepOpen?: boolean | undefined;
123
134
  }
124
135
 
125
- type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>;
136
+ type StdioOptions =
137
+ | "pipe"
138
+ | "ignore"
139
+ | "inherit"
140
+ | Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>;
126
141
 
127
- type SerializationType = 'json' | 'advanced';
142
+ type SerializationType = "json" | "advanced";
128
143
 
129
144
  interface MessagingOptions {
130
145
  /**
@@ -173,11 +188,11 @@ declare module 'child_process' {
173
188
  }
174
189
 
175
190
  interface SpawnOptionsWithoutStdio extends SpawnOptions {
176
- stdio?: 'pipe' | Array<null | undefined | 'pipe'> | undefined;
191
+ stdio?: "pipe" | Array<null | undefined | "pipe"> | undefined;
177
192
  }
178
193
 
179
- type StdioNull = 'inherit' | 'ignore' | Stream;
180
- type StdioPipe = undefined | null | 'pipe';
194
+ type StdioNull = "inherit" | "ignore" | Stream;
195
+ type StdioPipe = undefined | null | "pipe";
181
196
 
182
197
  interface SpawnOptionsWithStdioTuple<
183
198
  Stdin extends StdioNull | StdioPipe,
@@ -226,7 +241,11 @@ declare module 'child_process' {
226
241
  function spawn(command: string, options: SpawnOptions): ChildProcess;
227
242
 
228
243
  // overloads of spawn with 'args'
229
- function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
244
+ function spawn(
245
+ command: string,
246
+ args?: ReadonlyArray<string>,
247
+ options?: SpawnOptionsWithoutStdio,
248
+ ): ChildProcessWithoutNullStreams;
230
249
 
231
250
  function spawn(
232
251
  command: string,
@@ -293,13 +312,24 @@ declare module 'child_process' {
293
312
  }
294
313
 
295
314
  // no `options` definitely means stdout/stderr are `string`.
296
- function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
315
+ function exec(
316
+ command: string,
317
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
318
+ ): ChildProcess;
297
319
 
298
320
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
299
- function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
321
+ function exec(
322
+ command: string,
323
+ options: { encoding: "buffer" | null } & ExecOptions,
324
+ callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
325
+ ): ChildProcess;
300
326
 
301
327
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
302
- function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
328
+ function exec(
329
+ command: string,
330
+ options: { encoding: BufferEncoding } & ExecOptions,
331
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
332
+ ): ChildProcess;
303
333
 
304
334
  // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
305
335
  // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
@@ -310,7 +340,11 @@ declare module 'child_process' {
310
340
  ): ChildProcess;
311
341
 
312
342
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
313
- function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
343
+ function exec(
344
+ command: string,
345
+ options: ExecOptions,
346
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void,
347
+ ): ChildProcess;
314
348
 
315
349
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
316
350
  function exec(
@@ -325,11 +359,23 @@ declare module 'child_process' {
325
359
 
326
360
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
327
361
  namespace exec {
328
- function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>;
329
- function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
330
- function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
331
- function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
332
- function __promisify__(command: string, options?: (BaseEncodingOptions & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
362
+ function __promisify__(command: string): PromiseWithChild<{ stdout: string; stderr: string }>;
363
+ function __promisify__(
364
+ command: string,
365
+ options: { encoding: "buffer" | null } & ExecOptions,
366
+ ): PromiseWithChild<{ stdout: Buffer; stderr: Buffer }>;
367
+ function __promisify__(
368
+ command: string,
369
+ options: { encoding: BufferEncoding } & ExecOptions,
370
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
371
+ function __promisify__(
372
+ command: string,
373
+ options: ExecOptions,
374
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
375
+ function __promisify__(
376
+ command: string,
377
+ options?: (BaseEncodingOptions & ExecOptions) | null,
378
+ ): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
333
379
  }
334
380
 
335
381
  interface ExecFileOptions extends CommonOptions {
@@ -342,27 +388,42 @@ declare module 'child_process' {
342
388
  encoding: BufferEncoding;
343
389
  }
344
390
  interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
345
- encoding: 'buffer' | null;
391
+ encoding: "buffer" | null;
346
392
  }
347
393
  interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
348
394
  encoding: BufferEncoding;
349
395
  }
350
396
  type ExecFileException =
351
- & Omit<ExecException, 'code'>
352
- & Omit<NodeJS.ErrnoException, 'code'>
397
+ & Omit<ExecException, "code">
398
+ & Omit<NodeJS.ErrnoException, "code">
353
399
  & { code?: string | number | undefined | null };
354
400
 
355
401
  function execFile(file: string): ChildProcess;
356
402
  function execFile(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
357
403
  function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
358
- function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
404
+ function execFile(
405
+ file: string,
406
+ args: ReadonlyArray<string> | undefined | null,
407
+ options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
408
+ ): ChildProcess;
359
409
 
360
410
  // no `options` definitely means stdout/stderr are `string`.
361
- function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
362
- function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
411
+ function execFile(
412
+ file: string,
413
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
414
+ ): ChildProcess;
415
+ function execFile(
416
+ file: string,
417
+ args: ReadonlyArray<string> | undefined | null,
418
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
419
+ ): ChildProcess;
363
420
 
364
421
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
365
- function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
422
+ function execFile(
423
+ file: string,
424
+ options: ExecFileOptionsWithBufferEncoding,
425
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
426
+ ): ChildProcess;
366
427
  function execFile(
367
428
  file: string,
368
429
  args: ReadonlyArray<string> | undefined | null,
@@ -371,7 +432,11 @@ declare module 'child_process' {
371
432
  ): ChildProcess;
372
433
 
373
434
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
374
- function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
435
+ function execFile(
436
+ file: string,
437
+ options: ExecFileOptionsWithStringEncoding,
438
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
439
+ ): ChildProcess;
375
440
  function execFile(
376
441
  file: string,
377
442
  args: ReadonlyArray<string> | undefined | null,
@@ -394,49 +459,89 @@ declare module 'child_process' {
394
459
  ): ChildProcess;
395
460
 
396
461
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
397
- function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
462
+ function execFile(
463
+ file: string,
464
+ options: ExecFileOptions,
465
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
466
+ ): ChildProcess;
398
467
  function execFile(
399
468
  file: string,
400
469
  args: ReadonlyArray<string> | undefined | null,
401
470
  options: ExecFileOptions,
402
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
471
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
403
472
  ): ChildProcess;
404
473
 
405
474
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
406
475
  function execFile(
407
476
  file: string,
408
477
  options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
409
- callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
478
+ callback:
479
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
480
+ | undefined
481
+ | null,
410
482
  ): ChildProcess;
411
483
  function execFile(
412
484
  file: string,
413
485
  args: ReadonlyArray<string> | undefined | null,
414
486
  options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
415
- callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
487
+ callback:
488
+ | ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void)
489
+ | undefined
490
+ | null,
416
491
  ): ChildProcess;
417
492
 
418
493
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
419
494
  namespace execFile {
420
- function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>;
421
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
422
- function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
423
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
424
- function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
425
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
426
- function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
495
+ function __promisify__(file: string): PromiseWithChild<{ stdout: string; stderr: string }>;
496
+ function __promisify__(
497
+ file: string,
498
+ args: ReadonlyArray<string> | undefined | null,
499
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
500
+ function __promisify__(
501
+ file: string,
502
+ options: ExecFileOptionsWithBufferEncoding,
503
+ ): PromiseWithChild<{ stdout: Buffer; stderr: Buffer }>;
504
+ function __promisify__(
505
+ file: string,
506
+ args: ReadonlyArray<string> | undefined | null,
507
+ options: ExecFileOptionsWithBufferEncoding,
508
+ ): PromiseWithChild<{ stdout: Buffer; stderr: Buffer }>;
509
+ function __promisify__(
510
+ file: string,
511
+ options: ExecFileOptionsWithStringEncoding,
512
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
513
+ function __promisify__(
514
+ file: string,
515
+ args: ReadonlyArray<string> | undefined | null,
516
+ options: ExecFileOptionsWithStringEncoding,
517
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
518
+ function __promisify__(
519
+ file: string,
520
+ options: ExecFileOptionsWithOtherEncoding,
521
+ ): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
427
522
  function __promisify__(
428
523
  file: string,
429
524
  args: ReadonlyArray<string> | undefined | null,
430
525
  options: ExecFileOptionsWithOtherEncoding,
431
- ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
432
- function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
433
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
434
- function __promisify__(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
526
+ ): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
527
+ function __promisify__(
528
+ file: string,
529
+ options: ExecFileOptions,
530
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
435
531
  function __promisify__(
436
532
  file: string,
437
533
  args: ReadonlyArray<string> | undefined | null,
534
+ options: ExecFileOptions,
535
+ ): PromiseWithChild<{ stdout: string; stderr: string }>;
536
+ function __promisify__(
537
+ file: string,
438
538
  options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
439
- ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
539
+ ): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
540
+ function __promisify__(
541
+ file: string,
542
+ args: ReadonlyArray<string> | undefined | null,
543
+ options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
544
+ ): PromiseWithChild<{ stdout: string | Buffer; stderr: string | Buffer }>;
440
545
  }
441
546
 
442
547
  interface ForkOptions extends ProcessEnvOptions, MessagingOptions {
@@ -463,13 +568,13 @@ declare module 'child_process' {
463
568
  input?: string | NodeJS.ArrayBufferView | undefined;
464
569
  killSignal?: NodeJS.Signals | number | undefined;
465
570
  maxBuffer?: number | undefined;
466
- encoding?: BufferEncoding | 'buffer' | null | undefined;
571
+ encoding?: BufferEncoding | "buffer" | null | undefined;
467
572
  }
468
573
  interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
469
574
  encoding: BufferEncoding;
470
575
  }
471
576
  interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
472
- encoding?: 'buffer' | null | undefined;
577
+ encoding?: "buffer" | null | undefined;
473
578
  }
474
579
  interface SpawnSyncReturns<T> {
475
580
  pid: number;
@@ -484,9 +589,21 @@ declare module 'child_process' {
484
589
  function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
485
590
  function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
486
591
  function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
487
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
488
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
489
- function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<string | Buffer>;
592
+ function spawnSync(
593
+ command: string,
594
+ args?: ReadonlyArray<string>,
595
+ options?: SpawnSyncOptionsWithStringEncoding,
596
+ ): SpawnSyncReturns<string>;
597
+ function spawnSync(
598
+ command: string,
599
+ args?: ReadonlyArray<string>,
600
+ options?: SpawnSyncOptionsWithBufferEncoding,
601
+ ): SpawnSyncReturns<Buffer>;
602
+ function spawnSync(
603
+ command: string,
604
+ args?: ReadonlyArray<string>,
605
+ options?: SpawnSyncOptions,
606
+ ): SpawnSyncReturns<string | Buffer>;
490
607
 
491
608
  interface ExecSyncOptions extends CommonOptions {
492
609
  input?: string | Uint8Array | undefined;
@@ -503,13 +620,13 @@ declare module 'child_process' {
503
620
  shell?: string | undefined;
504
621
  killSignal?: NodeJS.Signals | number | undefined;
505
622
  maxBuffer?: number | undefined;
506
- encoding?: BufferEncoding | 'buffer' | null | undefined;
623
+ encoding?: BufferEncoding | "buffer" | null | undefined;
507
624
  }
508
625
  interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
509
626
  encoding: BufferEncoding;
510
627
  }
511
628
  interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
512
- encoding?: 'buffer' | null | undefined;
629
+ encoding?: "buffer" | null | undefined;
513
630
  }
514
631
  function execSync(command: string): Buffer;
515
632
  function execSync(command: string, options: ExecSyncOptionsWithStringEncoding): string;
@@ -544,10 +661,22 @@ declare module 'child_process' {
544
661
  function execFileSync(command: string, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
545
662
  function execFileSync(command: string, options?: ExecFileSyncOptions): string | Buffer;
546
663
  function execFileSync(command: string, args: ReadonlyArray<string>): Buffer;
547
- function execFileSync(command: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithStringEncoding): string;
548
- function execFileSync(command: string, args: ReadonlyArray<string>, options: ExecFileSyncOptionsWithBufferEncoding): Buffer;
549
- function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): string | Buffer;
664
+ function execFileSync(
665
+ command: string,
666
+ args: ReadonlyArray<string>,
667
+ options: ExecFileSyncOptionsWithStringEncoding,
668
+ ): string;
669
+ function execFileSync(
670
+ command: string,
671
+ args: ReadonlyArray<string>,
672
+ options: ExecFileSyncOptionsWithBufferEncoding,
673
+ ): Buffer;
674
+ function execFileSync(
675
+ command: string,
676
+ args?: ReadonlyArray<string>,
677
+ options?: ExecFileSyncOptions,
678
+ ): string | Buffer;
550
679
  }
551
- declare module 'node:child_process' {
552
- export * from 'child_process';
680
+ declare module "node:child_process" {
681
+ export * from "child_process";
553
682
  }