@types/node 18.17.17 → 18.17.19

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 v18.17/README.md +1 -1
  2. node v18.17/assert/strict.d.ts +4 -4
  3. node v18.17/assert.d.ts +48 -24
  4. node v18.17/async_hooks.d.ts +10 -7
  5. node v18.17/buffer.d.ts +32 -34
  6. node v18.17/child_process.d.ts +262 -122
  7. node v18.17/cluster.d.ts +107 -89
  8. node v18.17/console.d.ts +7 -7
  9. node v18.17/constants.d.ts +12 -11
  10. node v18.17/crypto.d.ts +746 -268
  11. node v18.17/dgram.d.ts +81 -45
  12. node v18.17/diagnostics_channel.d.ts +3 -3
  13. node v18.17/dns/promises.d.ts +28 -25
  14. node v18.17/dns.d.ts +203 -62
  15. node v18.17/dom-events.d.ts +67 -71
  16. node v18.17/domain.d.ts +4 -4
  17. node v18.17/events.d.ts +15 -7
  18. node v18.17/fs/promises.d.ts +102 -73
  19. node v18.17/fs.d.ts +513 -311
  20. node v18.17/globals.d.ts +16 -18
  21. node v18.17/http.d.ts +185 -185
  22. node v18.17/http2.d.ts +628 -376
  23. node v18.17/https.d.ts +107 -105
  24. node v18.17/inspector.d.ts +3 -3
  25. node v18.17/module.d.ts +11 -8
  26. node v18.17/net.d.ts +112 -93
  27. node v18.17/os.d.ts +7 -7
  28. node v18.17/package.json +2 -2
  29. node v18.17/path.d.ts +13 -13
  30. node v18.17/perf_hooks.d.ts +20 -19
  31. node v18.17/process.d.ts +155 -125
  32. node v18.17/punycode.d.ts +3 -3
  33. node v18.17/querystring.d.ts +14 -4
  34. node v18.17/readline/promises.d.ts +5 -5
  35. node v18.17/readline.d.ts +69 -56
  36. node v18.17/repl.d.ts +67 -61
  37. node v18.17/stream/consumers.d.ts +4 -4
  38. node v18.17/stream/promises.d.ts +56 -15
  39. node v18.17/stream/web.d.ts +26 -20
  40. node v18.17/stream.d.ts +356 -226
  41. node v18.17/string_decoder.d.ts +3 -3
  42. node v18.17/test.d.ts +76 -91
  43. node v18.17/timers/promises.d.ts +4 -4
  44. node v18.17/timers.d.ts +23 -8
  45. node v18.17/tls.d.ts +151 -71
  46. node v18.17/trace_events.d.ts +3 -3
  47. node v18.17/ts4.8/assert/strict.d.ts +4 -4
  48. node v18.17/ts4.8/assert.d.ts +48 -24
  49. node v18.17/ts4.8/async_hooks.d.ts +10 -7
  50. node v18.17/ts4.8/buffer.d.ts +32 -34
  51. node v18.17/ts4.8/child_process.d.ts +262 -122
  52. node v18.17/ts4.8/cluster.d.ts +107 -89
  53. node v18.17/ts4.8/console.d.ts +7 -7
  54. node v18.17/ts4.8/constants.d.ts +12 -11
  55. node v18.17/ts4.8/crypto.d.ts +746 -268
  56. node v18.17/ts4.8/dgram.d.ts +81 -45
  57. node v18.17/ts4.8/diagnostics_channel.d.ts +3 -3
  58. node v18.17/ts4.8/dns/promises.d.ts +28 -25
  59. node v18.17/ts4.8/dns.d.ts +203 -62
  60. node v18.17/ts4.8/dom-events.d.ts +67 -71
  61. node v18.17/ts4.8/domain.d.ts +4 -4
  62. node v18.17/ts4.8/events.d.ts +15 -7
  63. node v18.17/ts4.8/fs/promises.d.ts +102 -73
  64. node v18.17/ts4.8/fs.d.ts +514 -312
  65. node v18.17/ts4.8/globals.d.ts +44 -46
  66. node v18.17/ts4.8/http.d.ts +185 -185
  67. node v18.17/ts4.8/http2.d.ts +628 -376
  68. node v18.17/ts4.8/https.d.ts +107 -105
  69. node v18.17/ts4.8/inspector.d.ts +3 -3
  70. node v18.17/ts4.8/module.d.ts +11 -8
  71. node v18.17/ts4.8/net.d.ts +112 -93
  72. node v18.17/ts4.8/os.d.ts +7 -7
  73. node v18.17/ts4.8/path.d.ts +13 -13
  74. node v18.17/ts4.8/perf_hooks.d.ts +20 -19
  75. node v18.17/ts4.8/process.d.ts +155 -125
  76. node v18.17/ts4.8/punycode.d.ts +3 -3
  77. node v18.17/ts4.8/querystring.d.ts +14 -4
  78. node v18.17/ts4.8/readline/promises.d.ts +5 -5
  79. node v18.17/ts4.8/readline.d.ts +69 -56
  80. node v18.17/ts4.8/repl.d.ts +67 -61
  81. node v18.17/ts4.8/stream/consumers.d.ts +4 -4
  82. node v18.17/ts4.8/stream/promises.d.ts +56 -15
  83. node v18.17/ts4.8/stream/web.d.ts +26 -20
  84. node v18.17/ts4.8/stream.d.ts +321 -217
  85. node v18.17/ts4.8/string_decoder.d.ts +3 -3
  86. node v18.17/ts4.8/test.d.ts +75 -90
  87. node v18.17/ts4.8/timers/promises.d.ts +4 -4
  88. node v18.17/ts4.8/timers.d.ts +23 -8
  89. node v18.17/ts4.8/tls.d.ts +151 -71
  90. node v18.17/ts4.8/trace_events.d.ts +3 -3
  91. node v18.17/ts4.8/tty.d.ts +10 -10
  92. node v18.17/ts4.8/url.d.ts +26 -14
  93. node v18.17/ts4.8/util.d.ts +178 -117
  94. node v18.17/ts4.8/v8.d.ts +4 -4
  95. node v18.17/ts4.8/vm.d.ts +60 -42
  96. node v18.17/ts4.8/wasi.d.ts +3 -3
  97. node v18.17/ts4.8/worker_threads.d.ts +82 -85
  98. node v18.17/ts4.8/zlib.d.ts +9 -9
  99. node v18.17/tty.d.ts +10 -10
  100. node v18.17/url.d.ts +26 -14
  101. node v18.17/util.d.ts +178 -117
  102. node v18.17/v8.d.ts +4 -4
  103. node v18.17/vm.d.ts +60 -42
  104. node v18.17/wasi.d.ts +3 -3
  105. node v18.17/worker_threads.d.ts +82 -85
  106. node v18.17/zlib.d.ts +9 -9
node v18.17/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/v18.
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
 
@@ -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 v18.17/assert.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * invariants.
4
4
  * @see [source](https://github.com/nodejs/node/blob/v18.0.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
@@ -20,7 +20,7 @@ declare module 'node: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 'node: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 'node: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)`.
@@ -846,7 +846,11 @@ declare module 'node:assert' {
846
846
  * @since v10.0.0
847
847
  */
848
848
  function rejects(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
849
- function rejects(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
849
+ function rejects(
850
+ block: (() => Promise<unknown>) | Promise<unknown>,
851
+ error: AssertPredicate,
852
+ message?: string | Error,
853
+ ): Promise<void>;
850
854
  /**
851
855
  * Awaits the `asyncFn` promise or, if `asyncFn` is a function, immediately
852
856
  * calls the function and awaits the returned promise to complete. It will then
@@ -889,8 +893,15 @@ declare module 'node:assert' {
889
893
  * ```
890
894
  * @since v10.0.0
891
895
  */
892
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, message?: string | Error): Promise<void>;
893
- function doesNotReject(block: (() => Promise<unknown>) | Promise<unknown>, error: AssertPredicate, message?: string | Error): Promise<void>;
896
+ function doesNotReject(
897
+ block: (() => Promise<unknown>) | Promise<unknown>,
898
+ message?: string | Error,
899
+ ): Promise<void>;
900
+ function doesNotReject(
901
+ block: (() => Promise<unknown>) | Promise<unknown>,
902
+ error: AssertPredicate,
903
+ message?: string | Error,
904
+ ): Promise<void>;
894
905
  /**
895
906
  * Expects the `string` input to match the regular expression.
896
907
  *
@@ -937,25 +948,38 @@ declare module 'node:assert' {
937
948
  * @since v13.6.0, v12.16.0
938
949
  */
939
950
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
940
- const strict: Omit<typeof assert, 'equal' | 'notEqual' | 'deepEqual' | 'notDeepEqual' | 'ok' | 'strictEqual' | 'deepStrictEqual' | 'ifError' | 'strict'> & {
941
- (value: unknown, message?: string | Error): asserts value;
942
- equal: typeof strictEqual;
943
- notEqual: typeof notStrictEqual;
944
- deepEqual: typeof deepStrictEqual;
945
- notDeepEqual: typeof notDeepStrictEqual;
946
- // Mapped types and assertion functions are incompatible?
947
- // TS2775: Assertions require every name in the call target
948
- // to be declared with an explicit type annotation.
949
- ok: typeof ok;
950
- strictEqual: typeof strictEqual;
951
- deepStrictEqual: typeof deepStrictEqual;
952
- ifError: typeof ifError;
953
- strict: typeof strict;
954
- };
951
+ const strict:
952
+ & Omit<
953
+ typeof assert,
954
+ | "equal"
955
+ | "notEqual"
956
+ | "deepEqual"
957
+ | "notDeepEqual"
958
+ | "ok"
959
+ | "strictEqual"
960
+ | "deepStrictEqual"
961
+ | "ifError"
962
+ | "strict"
963
+ >
964
+ & {
965
+ (value: unknown, message?: string | Error): asserts value;
966
+ equal: typeof strictEqual;
967
+ notEqual: typeof notStrictEqual;
968
+ deepEqual: typeof deepStrictEqual;
969
+ notDeepEqual: typeof notDeepStrictEqual;
970
+ // Mapped types and assertion functions are incompatible?
971
+ // TS2775: Assertions require every name in the call target
972
+ // to be declared with an explicit type annotation.
973
+ ok: typeof ok;
974
+ strictEqual: typeof strictEqual;
975
+ deepStrictEqual: typeof deepStrictEqual;
976
+ ifError: typeof ifError;
977
+ strict: typeof strict;
978
+ };
955
979
  }
956
980
  export = assert;
957
981
  }
958
- declare module 'assert' {
959
- import assert = require('node:assert');
982
+ declare module "node:assert" {
983
+ import assert = require("assert");
960
984
  export = assert;
961
985
  }
@@ -8,7 +8,7 @@
8
8
  * @experimental
9
9
  * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/async_hooks.js)
10
10
  */
11
- declare module 'node: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 'node: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 'node: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 'node: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 'node: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;
@@ -514,6 +517,6 @@ declare module 'node:async_hooks' {
514
517
  enterWith(store: T): void;
515
518
  }
516
519
  }
517
- declare module 'async_hooks' {
518
- export * from 'node:async_hooks';
520
+ declare module "node:async_hooks" {
521
+ export * from "async_hooks";
519
522
  }
node v18.17/buffer.d.ts CHANGED
@@ -43,9 +43,9 @@
43
43
  * ```
44
44
  * @see [source](https://github.com/nodejs/node/blob/v18.0.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
  export function isUtf8(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
50
50
  export function isAscii(input: Buffer | ArrayBuffer | NodeJS.TypedArray): boolean;
51
51
  export const INSPECT_MAX_BYTES: number;
@@ -55,7 +55,7 @@ declare module 'node:buffer' {
55
55
  MAX_LENGTH: number;
56
56
  MAX_STRING_LENGTH: number;
57
57
  };
58
- export type TranscodeEncoding = 'ascii' | 'utf8' | 'utf16le' | 'ucs2' | 'latin1' | 'binary';
58
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
59
59
  /**
60
60
  * Re-encodes the given `Buffer` or `Uint8Array` instance from one character
61
61
  * encoding to another. Returns a new `Buffer` instance.
@@ -86,7 +86,7 @@ declare module 'node:buffer' {
86
86
  export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
87
87
  export const SlowBuffer: {
88
88
  /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
89
- new (size: number): Buffer;
89
+ new(size: number): Buffer;
90
90
  prototype: Buffer;
91
91
  };
92
92
  /**
@@ -170,7 +170,7 @@ declare module 'node:buffer' {
170
170
  * One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be
171
171
  * converted to the platform native line-ending as specified by `require('node:os').EOL`.
172
172
  */
173
- endings?: 'native' | 'transparent';
173
+ endings?: "native" | "transparent";
174
174
  /** The File content-type. */
175
175
  type?: string;
176
176
  /** The last modified date of the file. `Default`: Date.now(). */
@@ -197,7 +197,7 @@ declare module 'node:buffer' {
197
197
  export import atob = globalThis.atob;
198
198
  export import btoa = globalThis.btoa;
199
199
 
200
- import { Blob as NodeBlob } from 'buffer';
200
+ import { Blob as NodeBlob } from "buffer";
201
201
  // This conditional type will be the existing global Blob in a browser, or
202
202
  // the copy below in a Node environment.
203
203
  type __Blob = typeof globalThis extends { onmessage: any; Blob: infer T } ? T : NodeBlob;
@@ -207,22 +207,22 @@ declare module 'node:buffer' {
207
207
  }
208
208
  // Buffer class
209
209
  type BufferEncoding =
210
- | 'ascii'
211
- | 'utf8'
212
- | 'utf-8'
213
- | 'utf16le'
214
- | 'ucs2'
215
- | 'ucs-2'
216
- | 'base64'
217
- | 'base64url'
218
- | 'latin1'
219
- | 'binary'
220
- | 'hex';
210
+ | "ascii"
211
+ | "utf8"
212
+ | "utf-8"
213
+ | "utf16le"
214
+ | "ucs2"
215
+ | "ucs-2"
216
+ | "base64"
217
+ | "base64url"
218
+ | "latin1"
219
+ | "binary"
220
+ | "hex";
221
221
  type WithImplicitCoercion<T> =
222
222
  | T
223
223
  | {
224
- valueOf(): T;
225
- };
224
+ valueOf(): T;
225
+ };
226
226
  /**
227
227
  * Raw data is stored in instances of the Buffer class.
228
228
  * 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.
@@ -236,44 +236,43 @@ declare module 'node:buffer' {
236
236
  * @param encoding encoding to use, optional. Default is 'utf8'
237
237
  * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
238
238
  */
239
- new (str: string, encoding?: BufferEncoding): Buffer;
239
+ new(str: string, encoding?: BufferEncoding): Buffer;
240
240
  /**
241
241
  * Allocates a new buffer of {size} octets.
242
242
  *
243
243
  * @param size count of octets to allocate.
244
244
  * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
245
245
  */
246
- new (size: number): Buffer;
246
+ new(size: number): Buffer;
247
247
  /**
248
248
  * Allocates a new buffer containing the given {array} of octets.
249
249
  *
250
250
  * @param array The octets to store.
251
251
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
252
252
  */
253
- new (array: Uint8Array): Buffer;
253
+ new(array: Uint8Array): Buffer;
254
254
  /**
255
255
  * Produces a Buffer backed by the same allocated memory as
256
256
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
257
257
  *
258
- *
259
258
  * @param arrayBuffer The ArrayBuffer with which to share memory.
260
259
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
261
260
  */
262
- new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
261
+ new(arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
263
262
  /**
264
263
  * Allocates a new buffer containing the given {array} of octets.
265
264
  *
266
265
  * @param array The octets to store.
267
266
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
268
267
  */
269
- new (array: ReadonlyArray<any>): Buffer;
268
+ new(array: ReadonlyArray<any>): Buffer;
270
269
  /**
271
270
  * Copies the passed {buffer} data onto a new {Buffer} instance.
272
271
  *
273
272
  * @param buffer The buffer to copy.
274
273
  * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
275
274
  */
276
- new (buffer: Buffer): Buffer;
275
+ new(buffer: Buffer): Buffer;
277
276
  /**
278
277
  * Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
279
278
  * Array entries outside that range will be truncated to fit into it.
@@ -311,8 +310,8 @@ declare module 'node:buffer' {
311
310
  str:
312
311
  | WithImplicitCoercion<string>
313
312
  | {
314
- [Symbol.toPrimitive](hint: 'string'): string;
315
- },
313
+ [Symbol.toPrimitive](hint: "string"): string;
314
+ },
316
315
  encoding?: BufferEncoding,
317
316
  ): Buffer;
318
317
  /**
@@ -693,7 +692,7 @@ declare module 'node:buffer' {
693
692
  * @since v0.9.2
694
693
  */
695
694
  toJSON(): {
696
- type: 'Buffer';
695
+ type: "Buffer";
697
696
  data: number[];
698
697
  };
699
698
  /**
@@ -2313,11 +2312,10 @@ declare module 'node:buffer' {
2313
2312
  var Blob: typeof globalThis extends {
2314
2313
  onmessage: any;
2315
2314
  Blob: infer T;
2316
- }
2317
- ? T
2315
+ } ? T
2318
2316
  : typeof NodeBlob;
2319
2317
  }
2320
2318
  }
2321
- declare module 'buffer' {
2322
- export * from 'node:buffer';
2319
+ declare module "node:buffer" {
2320
+ export * from "buffer";
2323
2321
  }