@types/node 16.18.53 → 16.18.55

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 (100) hide show
  1. node v16.18/README.md +1 -1
  2. node v16.18/assert/strict.d.ts +4 -4
  3. node v16.18/assert.d.ts +48 -24
  4. node v16.18/async_hooks.d.ts +10 -7
  5. node v16.18/buffer.d.ts +47 -24
  6. node v16.18/child_process.d.ts +262 -122
  7. node v16.18/cluster.d.ts +107 -89
  8. node v16.18/console.d.ts +7 -7
  9. node v16.18/constants.d.ts +12 -11
  10. node v16.18/crypto.d.ts +738 -267
  11. node v16.18/dgram.d.ts +81 -45
  12. node v16.18/diagnostics_channel.d.ts +3 -3
  13. node v16.18/dns/promises.d.ts +28 -25
  14. node v16.18/dns.d.ts +202 -61
  15. node v16.18/domain.d.ts +4 -4
  16. node v16.18/events.d.ts +15 -7
  17. node v16.18/fs/promises.d.ts +93 -64
  18. node v16.18/fs.d.ts +485 -290
  19. node v16.18/globals.d.ts +13 -13
  20. node v16.18/http.d.ts +237 -157
  21. node v16.18/http2.d.ts +628 -376
  22. node v16.18/https.d.ts +107 -105
  23. node v16.18/module.d.ts +11 -8
  24. node v16.18/net.d.ts +106 -87
  25. node v16.18/os.d.ts +7 -7
  26. node v16.18/package.json +2 -2
  27. node v16.18/path.d.ts +13 -13
  28. node v16.18/perf_hooks.d.ts +17 -15
  29. node v16.18/process.d.ts +144 -124
  30. node v16.18/punycode.d.ts +3 -3
  31. node v16.18/querystring.d.ts +14 -4
  32. node v16.18/readline.d.ts +64 -54
  33. node v16.18/repl.d.ts +67 -61
  34. node v16.18/stream/consumers.d.ts +4 -4
  35. node v16.18/stream/promises.d.ts +56 -15
  36. node v16.18/stream/web.d.ts +19 -19
  37. node v16.18/stream.d.ts +314 -216
  38. node v16.18/string_decoder.d.ts +3 -3
  39. node v16.18/test.d.ts +2 -2
  40. node v16.18/timers/promises.d.ts +4 -4
  41. node v16.18/timers.d.ts +23 -8
  42. node v16.18/tls.d.ts +150 -71
  43. node v16.18/trace_events.d.ts +3 -3
  44. node v16.18/ts4.8/assert/strict.d.ts +4 -4
  45. node v16.18/ts4.8/assert.d.ts +48 -24
  46. node v16.18/ts4.8/async_hooks.d.ts +10 -7
  47. node v16.18/ts4.8/buffer.d.ts +47 -24
  48. node v16.18/ts4.8/child_process.d.ts +262 -122
  49. node v16.18/ts4.8/cluster.d.ts +107 -89
  50. node v16.18/ts4.8/console.d.ts +7 -7
  51. node v16.18/ts4.8/constants.d.ts +12 -11
  52. node v16.18/ts4.8/crypto.d.ts +738 -267
  53. node v16.18/ts4.8/dgram.d.ts +81 -45
  54. node v16.18/ts4.8/diagnostics_channel.d.ts +3 -3
  55. node v16.18/ts4.8/dns/promises.d.ts +28 -25
  56. node v16.18/ts4.8/dns.d.ts +202 -61
  57. node v16.18/ts4.8/domain.d.ts +4 -4
  58. node v16.18/ts4.8/events.d.ts +15 -7
  59. node v16.18/ts4.8/fs/promises.d.ts +93 -64
  60. node v16.18/ts4.8/fs.d.ts +485 -290
  61. node v16.18/ts4.8/globals.d.ts +13 -13
  62. node v16.18/ts4.8/http.d.ts +236 -156
  63. node v16.18/ts4.8/http2.d.ts +628 -376
  64. node v16.18/ts4.8/https.d.ts +107 -105
  65. node v16.18/ts4.8/module.d.ts +11 -8
  66. node v16.18/ts4.8/net.d.ts +106 -87
  67. node v16.18/ts4.8/os.d.ts +7 -7
  68. node v16.18/ts4.8/path.d.ts +13 -13
  69. node v16.18/ts4.8/perf_hooks.d.ts +17 -15
  70. node v16.18/ts4.8/process.d.ts +144 -124
  71. node v16.18/ts4.8/punycode.d.ts +3 -3
  72. node v16.18/ts4.8/querystring.d.ts +14 -4
  73. node v16.18/ts4.8/readline.d.ts +64 -54
  74. node v16.18/ts4.8/repl.d.ts +67 -61
  75. node v16.18/ts4.8/stream/consumers.d.ts +4 -4
  76. node v16.18/ts4.8/stream/promises.d.ts +56 -15
  77. node v16.18/ts4.8/stream/web.d.ts +19 -19
  78. node v16.18/ts4.8/stream.d.ts +309 -214
  79. node v16.18/ts4.8/string_decoder.d.ts +3 -3
  80. node v16.18/ts4.8/test.d.ts +2 -2
  81. node v16.18/ts4.8/timers/promises.d.ts +4 -4
  82. node v16.18/ts4.8/timers.d.ts +23 -8
  83. node v16.18/ts4.8/tls.d.ts +150 -71
  84. node v16.18/ts4.8/trace_events.d.ts +3 -3
  85. node v16.18/ts4.8/tty.d.ts +10 -10
  86. node v16.18/ts4.8/url.d.ts +26 -14
  87. node v16.18/ts4.8/util.d.ts +122 -51
  88. node v16.18/ts4.8/v8.d.ts +4 -4
  89. node v16.18/ts4.8/vm.d.ts +18 -18
  90. node v16.18/ts4.8/wasi.d.ts +3 -3
  91. node v16.18/ts4.8/worker_threads.d.ts +77 -77
  92. node v16.18/ts4.8/zlib.d.ts +9 -9
  93. node v16.18/tty.d.ts +10 -10
  94. node v16.18/url.d.ts +26 -14
  95. node v16.18/util.d.ts +122 -51
  96. node v16.18/v8.d.ts +4 -4
  97. node v16.18/vm.d.ts +18 -18
  98. node v16.18/wasi.d.ts +3 -3
  99. node v16.18/worker_threads.d.ts +77 -77
  100. node v16.18/zlib.d.ts +9 -9
node v16.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/v16.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 20 Sep 2023 03:06:41 GMT
11
+ * Last updated: Fri, 29 Sep 2023 15:35:13 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
@@ -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 v16.18/assert.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * invariants.
4
4
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/assert.js)
5
5
  */
6
- declare module 'assert' {
6
+ declare module "assert" {
7
7
  /**
8
8
  * An alias of {@link ok}.
9
9
  * @since v0.5.9
@@ -20,7 +20,7 @@ declare module 'assert' {
20
20
  expected: unknown;
21
21
  operator: string;
22
22
  generatedMessage: boolean;
23
- code: 'ERR_ASSERTION';
23
+ code: "ERR_ASSERTION";
24
24
  constructor(options?: {
25
25
  /** If provided, the error message is set to this value. */
26
26
  message?: string | undefined;
@@ -186,7 +186,7 @@ declare module 'assert' {
186
186
  /** A stack trace of the function. */
187
187
  stack: object;
188
188
  }
189
- type AssertPredicate = RegExp | (new () => object) | ((thrown: unknown) => boolean) | object | Error;
189
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: unknown) => boolean) | object | Error;
190
190
  /**
191
191
  * Throws an `AssertionError` with the provided error message or a default
192
192
  * error message. If the `message` parameter is an instance of an `Error` then
@@ -218,7 +218,7 @@ declare module 'assert' {
218
218
  message?: string | Error,
219
219
  operator?: string,
220
220
  // tslint:disable-next-line:ban-types
221
- stackStartFn?: Function
221
+ stackStartFn?: Function,
222
222
  ): never;
223
223
  /**
224
224
  * Tests if `value` is truthy. It is equivalent to`assert.equal(!!value, true, message)`.
@@ -847,7 +847,11 @@ declare module 'assert' {
847
847
  * @since v10.0.0
848
848
  */
849
849
  function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
850
- function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
850
+ function rejects(
851
+ block: (() => Promise<unknown>) | Promise<unknown>,
852
+ error: AssertPredicate,
853
+ message?: string | Error,
854
+ ): Promise<void>;
851
855
  /**
852
856
  * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
853
857
  * calls the function and awaits the returned promise to complete. It will then
@@ -890,8 +894,15 @@ declare module 'assert' {
890
894
  * ```
891
895
  * @since v10.0.0
892
896
  */
893
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
894
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
897
+ function doesNotReject(
898
+ block: (() => Promise<unknown>) | Promise<unknown>,
899
+ message?: string | Error,
900
+ ): Promise<void>;
901
+ function doesNotReject(
902
+ block: (() => Promise<unknown>) | Promise<unknown>,
903
+ error: AssertPredicate,
904
+ message?: string | Error,
905
+ ): Promise<void>;
895
906
  /**
896
907
  * Expects the `string` input to match the regular expression.
897
908
  *
@@ -938,25 +949,38 @@ declare module 'assert' {
938
949
  * @since v13.6.0, v12.16.0
939
950
  */
940
951
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
941
- const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
942
- (value: unknown, message?: string | Error): asserts value;
943
- equal: typeof strictEqual;
944
- notEqual: typeof notStrictEqual;
945
- deepEqual: typeof deepStrictEqual;
946
- notDeepEqual: typeof notDeepStrictEqual;
947
- // Mapped types and assertion functions are incompatible?
948
- // TS2775: Assertions require every name in the call target
949
- // to be declared with an explicit type annotation.
950
- ok: typeof ok;
951
- strictEqual: typeof strictEqual;
952
- deepStrictEqual: typeof deepStrictEqual;
953
- ifError: typeof ifError;
954
- strict: typeof strict;
955
- };
952
+ const strict:
953
+ & Omit<
954
+ typeof assert,
955
+ | "equal"
956
+ | "notEqual"
957
+ | "deepEqual"
958
+ | "notDeepEqual"
959
+ | "ok"
960
+ | "strictEqual"
961
+ | "deepStrictEqual"
962
+ | "ifError"
963
+ | "strict"
964
+ >
965
+ & {
966
+ (value: unknown, message?: string | Error): asserts value;
967
+ equal: typeof strictEqual;
968
+ notEqual: typeof notStrictEqual;
969
+ deepEqual: typeof deepStrictEqual;
970
+ notDeepEqual: typeof notDeepStrictEqual;
971
+ // Mapped types and assertion functions are incompatible?
972
+ // TS2775: Assertions require every name in the call target
973
+ // to be declared with an explicit type annotation.
974
+ ok: typeof ok;
975
+ strictEqual: typeof strictEqual;
976
+ deepStrictEqual: typeof deepStrictEqual;
977
+ ifError: typeof ifError;
978
+ strict: typeof strict;
979
+ };
956
980
  }
957
981
  export = assert;
958
982
  }
959
- declare module 'node:assert' {
960
- import assert = require('assert');
983
+ declare module "node:assert" {
984
+ import assert = require("assert");
961
985
  export = assert;
962
986
  }
@@ -8,7 +8,7 @@
8
8
  * @experimental
9
9
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/async_hooks.js)
10
10
  */
11
- declare module 'async_hooks' {
11
+ declare module "async_hooks" {
12
12
  /**
13
13
  * ```js
14
14
  * import { executionAsyncId } from 'async_hooks';
@@ -273,7 +273,7 @@ declare module 'async_hooks' {
273
273
  static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
274
274
  fn: Func,
275
275
  type?: string,
276
- thisArg?: ThisArg
276
+ thisArg?: ThisArg,
277
277
  ): Func & {
278
278
  asyncResource: AsyncResource;
279
279
  };
@@ -286,7 +286,7 @@ declare module 'async_hooks' {
286
286
  * @param fn The function to bind to the current `AsyncResource`.
287
287
  */
288
288
  bind<Func extends (...args: any[]) => any>(
289
- fn: Func
289
+ fn: Func,
290
290
  ): Func & {
291
291
  asyncResource: AsyncResource;
292
292
  };
@@ -300,7 +300,11 @@ declare module 'async_hooks' {
300
300
  * @param thisArg The receiver to be used for the function call.
301
301
  * @param args Optional arguments to pass to the function.
302
302
  */
303
- runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
303
+ runInAsyncScope<This, Result>(
304
+ fn: (this: This, ...args: any[]) => Result,
305
+ thisArg?: This,
306
+ ...args: any[]
307
+ ): Result;
304
308
  /**
305
309
  * Call all `destroy` hooks. This should only ever be called once. An error will
306
310
  * be thrown if it is called more than once. This **must** be manually called. If
@@ -314,7 +318,6 @@ declare module 'async_hooks' {
314
318
  */
315
319
  asyncId(): number;
316
320
  /**
317
- *
318
321
  * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
319
322
  */
320
323
  triggerAsyncId(): number;
@@ -493,6 +496,6 @@ declare module 'async_hooks' {
493
496
  enterWith(store: T): void;
494
497
  }
495
498
  }
496
- declare module 'node:async_hooks' {
497
- export * from 'async_hooks';
499
+ declare module "node:async_hooks" {
500
+ export * from "async_hooks";
498
501
  }
node v16.18/buffer.d.ts CHANGED
@@ -43,9 +43,9 @@
43
43
  * ```
44
44
  * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/buffer.js)
45
45
  */
46
- declare module '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
  export const INSPECT_MAX_BYTES: number;
50
50
  export const kMaxLength: number;
51
51
  export const kStringMaxLength: number;
@@ -53,7 +53,7 @@ declare module 'buffer' {
53
53
  MAX_LENGTH: number;
54
54
  MAX_STRING_LENGTH: number;
55
55
  };
56
- export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary';
56
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
57
57
  /**
58
58
  * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
59
59
  * encoding to another. Returns a new `Buffer` instance.
@@ -84,7 +84,7 @@ declare module 'buffer' {
84
84
  export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
85
85
  export const SlowBuffer: {
86
86
  /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
87
- new (size: number): Buffer;
87
+ new(size: number): Buffer;
88
88
  prototype: Buffer;
89
89
  };
90
90
  /**
@@ -171,12 +171,23 @@ declare module 'buffer' {
171
171
  export { BufferEncoding };
172
172
  }
173
173
  // Buffer class
174
- type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex';
174
+ type BufferEncoding =
175
+ | "ascii"
176
+ | "utf8"
177
+ | "utf-8"
178
+ | "utf16le"
179
+ | "ucs2"
180
+ | "ucs-2"
181
+ | "base64"
182
+ | "base64url"
183
+ | "latin1"
184
+ | "binary"
185
+ | "hex";
175
186
  type WithImplicitCoercion<T> =
176
187
  | T
177
188
  | {
178
- valueOf(): T;
179
- };
189
+ valueOf(): T;
190
+ };
180
191
  /**
181
192
  * Raw data is stored in instances of the Buffer class.
182
193
  * 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.
@@ -190,44 +201,43 @@ declare module 'buffer' {
190
201
  * @param encoding encoding to use, optional. Default is 'utf8'
191
202
  * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
192
203
  */
193
- new (str: string, encoding?: BufferEncoding): Buffer;
204
+ new(str: string, encoding?: BufferEncoding): Buffer;
194
205
  /**
195
206
  * Allocates a new buffer of {size} octets.
196
207
  *
197
208
  * @param size count of octets to allocate.
198
209
  * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
199
210
  */
200
- new (size: number): Buffer;
211
+ new(size: number): Buffer;
201
212
  /**
202
213
  * Allocates a new buffer containing the given {array} of octets.
203
214
  *
204
215
  * @param array The octets to store.
205
216
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
206
217
  */
207
- new (array: Uint8Array): Buffer;
218
+ new(array: Uint8Array): Buffer;
208
219
  /**
209
220
  * Produces a Buffer backed by the same allocated memory as
210
221
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
211
222
  *
212
- *
213
223
  * @param arrayBuffer The ArrayBuffer with which to share memory.
214
224
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
215
225
  */
216
- new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
226
+ new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
217
227
  /**
218
228
  * Allocates a new buffer containing the given {array} of octets.
219
229
  *
220
230
  * @param array The octets to store.
221
231
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
222
232
  */
223
- new (array: ReadonlyArray<any>): Buffer;
233
+ new(array: ReadonlyArray<any>): Buffer;
224
234
  /**
225
235
  * Copies the passed {buffer} data onto a new {Buffer} instance.
226
236
  *
227
237
  * @param buffer The buffer to copy.
228
238
  * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
229
239
  */
230
- new (buffer: Buffer): Buffer;
240
+ new(buffer: Buffer): Buffer;
231
241
  /**
232
242
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
233
243
  * Array entries outside that range will be truncated to fit into it.
@@ -245,7 +255,11 @@ declare module 'buffer' {
245
255
  * `Buffer.from(array)` and `Buffer.from(string)` may also use the internal`Buffer` pool like `Buffer.allocUnsafe()` does.
246
256
  * @since v5.10.0
247
257
  */
248
- from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
258
+ from(
259
+ arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>,
260
+ byteOffset?: number,
261
+ length?: number,
262
+ ): Buffer;
249
263
  /**
250
264
  * Creates a new Buffer using the passed {data}
251
265
  * @param data data to create a new Buffer
@@ -261,9 +275,9 @@ declare module 'buffer' {
261
275
  str:
262
276
  | WithImplicitCoercion<string>
263
277
  | {
264
- [Symbol.toPrimitive](hint: 'string'): string;
265
- },
266
- encoding?: BufferEncoding
278
+ [Symbol.toPrimitive](hint: "string"): string;
279
+ },
280
+ encoding?: BufferEncoding,
267
281
  ): Buffer;
268
282
  /**
269
283
  * Creates a new Buffer using the passed {data}
@@ -337,7 +351,10 @@ declare module 'buffer' {
337
351
  * @param [encoding='utf8'] If `string` is a string, this is its encoding.
338
352
  * @return The number of bytes contained within `string`.
339
353
  */
340
- byteLength(string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number;
354
+ byteLength(
355
+ string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
356
+ encoding?: BufferEncoding,
357
+ ): number;
341
358
  /**
342
359
  * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together.
343
360
  *
@@ -632,7 +649,7 @@ declare module 'buffer' {
632
649
  * @since v0.9.2
633
650
  */
634
651
  toJSON(): {
635
- type: 'Buffer';
652
+ type: "Buffer";
636
653
  data: number[];
637
654
  };
638
655
  /**
@@ -708,7 +725,13 @@ declare module 'buffer' {
708
725
  * @param [sourceStart=0] The offset within `buf` at which to begin comparison.
709
726
  * @param [sourceEnd=buf.length] The offset within `buf` at which to end comparison (not inclusive).
710
727
  */
711
- compare(target: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
728
+ compare(
729
+ target: Uint8Array,
730
+ targetStart?: number,
731
+ targetEnd?: number,
732
+ sourceStart?: number,
733
+ sourceEnd?: number,
734
+ ): number;
712
735
  /**
713
736
  * Copies data from a region of `buf` to a region in `target`, even if the `target`memory region overlaps with `buf`.
714
737
  *
@@ -2231,6 +2254,6 @@ declare module 'buffer' {
2231
2254
  function btoa(data: string): string;
2232
2255
  }
2233
2256
  }
2234
- declare module 'node:buffer' {
2235
- export * from 'buffer';
2257
+ declare module "node:buffer" {
2258
+ export * from "buffer";
2236
2259
  }