@types/node 20.6.2 → 20.6.4

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 (106) hide show
  1. node/README.md +1 -1
  2. node/assert/strict.d.ts +4 -4
  3. node/assert.d.ts +48 -24
  4. node/async_hooks.d.ts +13 -6
  5. node/buffer.d.ts +32 -34
  6. node/child_process.d.ts +262 -122
  7. node/cluster.d.ts +107 -89
  8. node/console.d.ts +7 -7
  9. node/constants.d.ts +12 -11
  10. node/crypto.d.ts +746 -268
  11. node/dgram.d.ts +81 -45
  12. node/diagnostics_channel.d.ts +3 -3
  13. node/dns/promises.d.ts +28 -25
  14. node/dns.d.ts +203 -62
  15. node/dom-events.d.ts +67 -71
  16. node/domain.d.ts +4 -4
  17. node/events.d.ts +15 -7
  18. node/fs/promises.d.ts +102 -73
  19. node/fs.d.ts +513 -311
  20. node/globals.d.ts +18 -20
  21. node/http.d.ts +238 -186
  22. node/http2.d.ts +628 -376
  23. node/https.d.ts +221 -112
  24. node/inspector.d.ts +3 -3
  25. node/module.d.ts +16 -9
  26. node/net.d.ts +112 -93
  27. node/os.d.ts +7 -7
  28. node/package.json +2 -2
  29. node/path.d.ts +13 -13
  30. node/perf_hooks.d.ts +19 -18
  31. node/process.d.ts +155 -125
  32. node/punycode.d.ts +3 -3
  33. node/querystring.d.ts +14 -4
  34. node/readline/promises.d.ts +12 -7
  35. node/readline.d.ts +69 -56
  36. node/repl.d.ts +67 -61
  37. node/stream/consumers.d.ts +5 -5
  38. node/stream/promises.d.ts +56 -15
  39. node/stream/web.d.ts +26 -20
  40. node/stream.d.ts +361 -228
  41. node/string_decoder.d.ts +3 -3
  42. node/test.d.ts +78 -93
  43. node/timers/promises.d.ts +4 -4
  44. node/timers.d.ts +23 -8
  45. node/tls.d.ts +151 -71
  46. node/trace_events.d.ts +3 -3
  47. node/ts4.8/assert/strict.d.ts +4 -4
  48. node/ts4.8/assert.d.ts +48 -24
  49. node/ts4.8/async_hooks.d.ts +13 -6
  50. node/ts4.8/buffer.d.ts +32 -34
  51. node/ts4.8/child_process.d.ts +262 -122
  52. node/ts4.8/cluster.d.ts +107 -89
  53. node/ts4.8/console.d.ts +7 -7
  54. node/ts4.8/constants.d.ts +12 -11
  55. node/ts4.8/crypto.d.ts +746 -268
  56. node/ts4.8/dgram.d.ts +81 -45
  57. node/ts4.8/diagnostics_channel.d.ts +3 -3
  58. node/ts4.8/dns/promises.d.ts +28 -25
  59. node/ts4.8/dns.d.ts +203 -62
  60. node/ts4.8/dom-events.d.ts +67 -71
  61. node/ts4.8/domain.d.ts +4 -4
  62. node/ts4.8/events.d.ts +15 -7
  63. node/ts4.8/fs/promises.d.ts +102 -73
  64. node/ts4.8/fs.d.ts +513 -311
  65. node/ts4.8/globals.d.ts +18 -20
  66. node/ts4.8/http.d.ts +238 -186
  67. node/ts4.8/http2.d.ts +628 -376
  68. node/ts4.8/https.d.ts +221 -112
  69. node/ts4.8/inspector.d.ts +3 -3
  70. node/ts4.8/module.d.ts +16 -9
  71. node/ts4.8/net.d.ts +112 -93
  72. node/ts4.8/os.d.ts +7 -7
  73. node/ts4.8/path.d.ts +13 -13
  74. node/ts4.8/perf_hooks.d.ts +19 -18
  75. node/ts4.8/process.d.ts +155 -125
  76. node/ts4.8/punycode.d.ts +3 -3
  77. node/ts4.8/querystring.d.ts +14 -4
  78. node/ts4.8/readline/promises.d.ts +12 -7
  79. node/ts4.8/readline.d.ts +69 -56
  80. node/ts4.8/repl.d.ts +67 -61
  81. node/ts4.8/stream/consumers.d.ts +5 -5
  82. node/ts4.8/stream/promises.d.ts +56 -15
  83. node/ts4.8/stream/web.d.ts +26 -20
  84. node/ts4.8/stream.d.ts +326 -219
  85. node/ts4.8/string_decoder.d.ts +3 -3
  86. node/ts4.8/test.d.ts +78 -93
  87. node/ts4.8/timers/promises.d.ts +4 -4
  88. node/ts4.8/timers.d.ts +23 -8
  89. node/ts4.8/tls.d.ts +151 -71
  90. node/ts4.8/trace_events.d.ts +3 -3
  91. node/ts4.8/tty.d.ts +10 -10
  92. node/ts4.8/url.d.ts +26 -14
  93. node/ts4.8/util.d.ts +178 -116
  94. node/ts4.8/v8.d.ts +4 -4
  95. node/ts4.8/vm.d.ts +52 -46
  96. node/ts4.8/wasi.d.ts +3 -3
  97. node/ts4.8/worker_threads.d.ts +81 -84
  98. node/ts4.8/zlib.d.ts +9 -9
  99. node/tty.d.ts +10 -10
  100. node/url.d.ts +26 -14
  101. node/util.d.ts +178 -116
  102. node/v8.d.ts +4 -4
  103. node/vm.d.ts +52 -46
  104. node/wasi.d.ts +3 -3
  105. node/worker_threads.d.ts +81 -84
  106. node/zlib.d.ts +9 -9
node/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.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Sat, 16 Sep 2023 06:34:52 GMT
11
+ * Last updated: Sat, 23 Sep 2023 20:38:33 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/assert/strict.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- declare module 'assert/strict' {
2
- import { strict } from 'node:assert';
1
+ declare module "assert/strict" {
2
+ import { strict } from "node:assert";
3
3
  export = strict;
4
4
  }
5
- declare module 'node:assert/strict' {
6
- import { strict } from 'node:assert';
5
+ declare module "node:assert/strict" {
6
+ import { strict } from "node:assert";
7
7
  export = strict;
8
8
  }
node/assert.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * invariants.
4
4
  * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/assert.js)
5
5
  */
6
- declare module 'node:assert' {
6
+ declare module "assert" {
7
7
  /**
8
8
  * An alias of {@link ok}.
9
9
  * @since v0.5.9
@@ -34,7 +34,7 @@ declare module 'node:assert' {
34
34
  /**
35
35
  * Value is always `ERR_ASSERTION` to show that the error is an assertion error.
36
36
  */
37
- code: 'ERR_ASSERTION';
37
+ code: "ERR_ASSERTION";
38
38
  constructor(options?: {
39
39
  /** If provided, the error message is set to this value. */
40
40
  message?: string | undefined;
@@ -197,7 +197,7 @@ declare module 'node:assert' {
197
197
  /** A stack trace of the function. */
198
198
  stack: object;
199
199
  }
200
- type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
200
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
201
201
  /**
202
202
  * Throws an `AssertionError` with the provided error message or a default
203
203
  * error message. If the `message` parameter is an instance of an `Error` then
@@ -229,7 +229,7 @@ declare module 'node:assert' {
229
229
  message?: string | Error,
230
230
  operator?: string,
231
231
  // tslint:disable-next-line:ban-types
232
- stackStartFn?: Function
232
+ stackStartFn?: Function,
233
233
  ): never;
234
234
  /**
235
235
  * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
@@ -857,7 +857,11 @@ declare module 'node:assert' {
857
857
  * @since v10.0.0
858
858
  */
859
859
  function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
860
- function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
860
+ function rejects(
861
+ block: (() => Promise<unknown>) | Promise<unknown>,
862
+ error: AssertPredicate,
863
+ message?: string | Error,
864
+ ): Promise<void>;
861
865
  /**
862
866
  * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
863
867
  * calls the function and awaits the returned promise to complete. It will then
@@ -900,8 +904,15 @@ declare module 'node:assert' {
900
904
  * ```
901
905
  * @since v10.0.0
902
906
  */
903
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
904
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
907
+ function doesNotReject(
908
+ block: (() => Promise<unknown>) | Promise<unknown>,
909
+ message?: string | Error,
910
+ ): Promise<void>;
911
+ function doesNotReject(
912
+ block: (() => Promise<unknown>) | Promise<unknown>,
913
+ error: AssertPredicate,
914
+ message?: string | Error,
915
+ ): Promise<void>;
905
916
  /**
906
917
  * Expects the `string` input to match the regular expression.
907
918
  *
@@ -948,25 +959,38 @@ declare module 'node:assert' {
948
959
  * @since v13.6.0, v12.16.0
949
960
  */
950
961
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
951
- const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
952
- (value: unknown, message?: string | Error): asserts value;
953
- equal: typeof strictEqual;
954
- notEqual: typeof notStrictEqual;
955
- deepEqual: typeof deepStrictEqual;
956
- notDeepEqual: typeof notDeepStrictEqual;
957
- // Mapped types and assertion functions are incompatible?
958
- // TS2775: Assertions require every name in the call target
959
- // to be declared with an explicit type annotation.
960
- ok: typeof ok;
961
- strictEqual: typeof strictEqual;
962
- deepStrictEqual: typeof deepStrictEqual;
963
- ifError: typeof ifError;
964
- strict: typeof strict;
965
- };
962
+ const strict:
963
+ & Omit<
964
+ typeof assert,
965
+ | "equal"
966
+ | "notEqual"
967
+ | "deepEqual"
968
+ | "notDeepEqual"
969
+ | "ok"
970
+ | "strictEqual"
971
+ | "deepStrictEqual"
972
+ | "ifError"
973
+ | "strict"
974
+ >
975
+ & {
976
+ (value: unknown, message?: string | Error): asserts value;
977
+ equal: typeof strictEqual;
978
+ notEqual: typeof notStrictEqual;
979
+ deepEqual: typeof deepStrictEqual;
980
+ notDeepEqual: typeof notDeepStrictEqual;
981
+ // Mapped types and assertion functions are incompatible?
982
+ // TS2775: Assertions require every name in the call target
983
+ // to be declared with an explicit type annotation.
984
+ ok: typeof ok;
985
+ strictEqual: typeof strictEqual;
986
+ deepStrictEqual: typeof deepStrictEqual;
987
+ ifError: typeof ifError;
988
+ strict: typeof strict;
989
+ };
966
990
  }
967
991
  export = assert;
968
992
  }
969
- declare module 'assert' {
970
- import assert = require('node:assert');
993
+ declare module "node:assert" {
994
+ import assert = require("assert");
971
995
  export = assert;
972
996
  }
node/async_hooks.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * @experimental
15
15
  * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
16
16
  */
17
- declare module 'node:async_hooks' {
17
+ declare module "async_hooks" {
18
18
  /**
19
19
  * ```js
20
20
  * import { executionAsyncId } from 'node:async_hooks';
@@ -275,7 +275,11 @@ declare module 'node:async_hooks' {
275
275
  * @param fn The function to bind to the current execution context.
276
276
  * @param type An optional name to associate with the underlying `AsyncResource`.
277
277
  */
278
- static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(fn: Func, type?: string, thisArg?: ThisArg): Func;
278
+ static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
279
+ fn: Func,
280
+ type?: string,
281
+ thisArg?: ThisArg,
282
+ ): Func;
279
283
  /**
280
284
  * Binds the given function to execute to this `AsyncResource`'s scope.
281
285
  * @since v14.8.0, v12.19.0
@@ -292,7 +296,11 @@ declare module 'node:async_hooks' {
292
296
  * @param thisArg The receiver to be used for the function call.
293
297
  * @param args Optional arguments to pass to the function.
294
298
  */
295
- runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
299
+ runInAsyncScope<This, Result>(
300
+ fn: (this: This, ...args: any[]) => Result,
301
+ thisArg?: This,
302
+ ...args: any[]
303
+ ): Result;
296
304
  /**
297
305
  * Call all `destroy` hooks. This should only ever be called once. An error will
298
306
  * be thrown if it is called more than once. This **must** be manually called. If
@@ -306,7 +314,6 @@ declare module 'node:async_hooks' {
306
314
  */
307
315
  asyncId(): number;
308
316
  /**
309
- *
310
317
  * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
311
318
  */
312
319
  triggerAsyncId(): number;
@@ -527,6 +534,6 @@ declare module 'node:async_hooks' {
527
534
  enterWith(store: T): void;
528
535
  }
529
536
  }
530
- declare module 'async_hooks' {
531
- export * from 'node:async_hooks';
537
+ declare module "node:async_hooks" {
538
+ export * from "async_hooks";
532
539
  }
node/buffer.d.ts CHANGED
@@ -43,9 +43,9 @@
43
43
  * ```
44
44
  * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/buffer.js)
45
45
  */
46
- declare module 'node:buffer' {
47
- import { BinaryLike } from 'node:crypto';
48
- import { ReadableStream as WebReadableStream } from 'node:stream/web';
46
+ declare module "buffer" {
47
+ import { BinaryLike } from "node:crypto";
48
+ import { ReadableStream as WebReadableStream } from "node:stream/web";
49
49
  /**
50
50
  * This function returns `true` if `input` contains only valid UTF-8-encoded data,
51
51
  * including the case in which `input` is empty.
@@ -71,7 +71,7 @@ declare module 'node:buffer' {
71
71
  MAX_LENGTH: number;
72
72
  MAX_STRING_LENGTH: number;
73
73
  };
74
- export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary';
74
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
75
75
  /**
76
76
  * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
77
77
  * encoding to another. Returns a new `Buffer` instance.
@@ -102,7 +102,7 @@ declare module 'node:buffer' {
102
102
  export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
103
103
  export const SlowBuffer: {
104
104
  /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
105
- new (size: number): Buffer;
105
+ new(size: number): Buffer;
106
106
  prototype: Buffer;
107
107
  };
108
108
  /**
@@ -186,7 +186,7 @@ declare module 'node:buffer' {
186
186
  * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
187
187
  * converted to the platform native line-ending as specified by `require('node:os').EOL`.
188
188
  */
189
- endings?: 'native' | 'transparent';
189
+ endings?: "native" | "transparent";
190
190
  /** The File content-type. */
191
191
  type?: string;
192
192
  /** The last modified date of the file. `Default`: Date.now(). */
@@ -211,7 +211,7 @@ declare module 'node:buffer' {
211
211
  }
212
212
  export import atob = globalThis.atob;
213
213
  export import btoa = globalThis.btoa;
214
- import { Blob as NodeBlob } from 'buffer';
214
+ import { Blob as NodeBlob } from "buffer";
215
215
  // This conditional type will be the existing global Blob in a browser, or
216
216
  // the copy below in a Node environment.
217
217
  type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob;
@@ -221,22 +221,22 @@ declare module 'node:buffer' {
221
221
  }
222
222
  // Buffer class
223
223
  type BufferEncoding =
224
- | 'ascii'
225
- | 'utf8'
226
- | 'utf-8'
227
- | 'utf16le'
228
- | 'ucs2'
229
- | 'ucs-2'
230
- | 'base64'
231
- | 'base64url'
232
- | 'latin1'
233
- | 'binary'
234
- | 'hex';
224
+ | "ascii"
225
+ | "utf8"
226
+ | "utf-8"
227
+ | "utf16le"
228
+ | "ucs2"
229
+ | "ucs-2"
230
+ | "base64"
231
+ | "base64url"
232
+ | "latin1"
233
+ | "binary"
234
+ | "hex";
235
235
  type WithImplicitCoercion<T> =
236
236
  | T
237
237
  | {
238
- valueOf(): T;
239
- };
238
+ valueOf(): T;
239
+ };
240
240
  /**
241
241
  * Raw data is stored in instances of the Buffer class.
242
242
  * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
@@ -250,44 +250,43 @@ declare module 'node:buffer' {
250
250
  * @param encoding encoding to use, optional. Default is 'utf8'
251
251
  * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
252
252
  */
253
- new (str: string, encoding?: BufferEncoding): Buffer;
253
+ new(str: string, encoding?: BufferEncoding): Buffer;
254
254
  /**
255
255
  * Allocates a new buffer of {size} octets.
256
256
  *
257
257
  * @param size count of octets to allocate.
258
258
  * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
259
259
  */
260
- new (size: number): Buffer;
260
+ new(size: number): Buffer;
261
261
  /**
262
262
  * Allocates a new buffer containing the given {array} of octets.
263
263
  *
264
264
  * @param array The octets to store.
265
265
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
266
266
  */
267
- new (array: Uint8Array): Buffer;
267
+ new(array: Uint8Array): Buffer;
268
268
  /**
269
269
  * Produces a Buffer backed by the same allocated memory as
270
270
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
271
271
  *
272
- *
273
272
  * @param arrayBuffer The ArrayBuffer with which to share memory.
274
273
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
275
274
  */
276
- new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
275
+ new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
277
276
  /**
278
277
  * Allocates a new buffer containing the given {array} of octets.
279
278
  *
280
279
  * @param array The octets to store.
281
280
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
282
281
  */
283
- new (array: ReadonlyArray<any>): Buffer;
282
+ new(array: ReadonlyArray<any>): Buffer;
284
283
  /**
285
284
  * Copies the passed {buffer} data onto a new {Buffer} instance.
286
285
  *
287
286
  * @param buffer The buffer to copy.
288
287
  * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
289
288
  */
290
- new (buffer: Buffer): Buffer;
289
+ new(buffer: Buffer): Buffer;
291
290
  /**
292
291
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
293
292
  * Array entries outside that range will be truncated to fit into it.
@@ -329,8 +328,8 @@ declare module 'node:buffer' {
329
328
  str:
330
329
  | WithImplicitCoercion<string>
331
330
  | {
332
- [Symbol.toPrimitive](hint: 'string'): string;
333
- },
331
+ [Symbol.toPrimitive](hint: "string"): string;
332
+ },
334
333
  encoding?: BufferEncoding,
335
334
  ): Buffer;
336
335
  /**
@@ -719,7 +718,7 @@ declare module 'node:buffer' {
719
718
  * @since v0.9.2
720
719
  */
721
720
  toJSON(): {
722
- type: 'Buffer';
721
+ type: "Buffer";
723
722
  data: number[];
724
723
  };
725
724
  /**
@@ -2344,11 +2343,10 @@ declare module 'node:buffer' {
2344
2343
  var Blob: typeof globalThis extends {
2345
2344
  onmessage: any;
2346
2345
  Blob: infer T;
2347
- }
2348
- ? T
2346
+ } ? T
2349
2347
  : typeof NodeBlob;
2350
2348
  }
2351
2349
  }
2352
- declare module 'buffer' {
2353
- export * from 'node:buffer';
2350
+ declare module "node:buffer" {
2351
+ export * from "buffer";
2354
2352
  }