@types/node 20.19.25 → 24.10.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 (79) hide show
  1. {node v20.19 → node v24.10}/README.md +3 -3
  2. node v24.10/assert/strict.d.ts +111 -0
  3. {node v20.19 → node v24.10}/assert.d.ts +150 -97
  4. {node v20.19 → node v24.10}/async_hooks.d.ts +27 -9
  5. {node v20.19 → node v24.10}/buffer.buffer.d.ts +2 -1
  6. {node v20.19 → node v24.10}/buffer.d.ts +6 -8
  7. {node v20.19 → node v24.10}/child_process.d.ts +11 -10
  8. {node v20.19 → node v24.10}/cluster.d.ts +16 -15
  9. {node v20.19 → node v24.10}/console.d.ts +19 -18
  10. {node v20.19 → node v24.10}/crypto.d.ts +1120 -293
  11. {node v20.19 → node v24.10}/dgram.d.ts +5 -2
  12. {node v20.19 → node v24.10}/diagnostics_channel.d.ts +1 -3
  13. {node v20.19 → node v24.10}/dns/promises.d.ts +30 -6
  14. {node v20.19 → node v24.10}/dns.d.ts +69 -17
  15. {node v20.19 → node v24.10}/domain.d.ts +1 -1
  16. {node v20.19 → node v24.10}/events.d.ts +1 -2
  17. {node v20.19 → node v24.10}/fs/promises.d.ts +85 -38
  18. {node v20.19 → node v24.10}/fs.d.ts +387 -48
  19. {node v20.19 → node v24.10}/globals.d.ts +2 -4
  20. {node v20.19 → node v24.10}/globals.typedarray.d.ts +3 -0
  21. {node v20.19 → node v24.10}/http.d.ts +90 -5
  22. {node v20.19 → node v24.10}/http2.d.ts +166 -41
  23. {node v20.19 → node v24.10}/https.d.ts +4 -3
  24. {node v20.19 → node v24.10}/index.d.ts +13 -5
  25. node v24.10/inspector.d.ts +277 -0
  26. {node v20.19 → node v24.10}/inspector.generated.d.ts +1096 -829
  27. {node v20.19 → node v24.10}/module.d.ts +403 -48
  28. {node v20.19 → node v24.10}/net.d.ts +62 -20
  29. {node v20.19 → node v24.10}/os.d.ts +8 -7
  30. {node v20.19 → node v24.10}/package.json +18 -3
  31. {node v20.19 → node v24.10}/path.d.ts +3 -3
  32. {node v20.19 → node v24.10}/perf_hooks.d.ts +37 -16
  33. {node v20.19 → node v24.10}/process.d.ts +138 -16
  34. {node v20.19 → node v24.10}/punycode.d.ts +1 -1
  35. {node v20.19 → node v24.10}/querystring.d.ts +1 -1
  36. {node v20.19 → node v24.10}/readline/promises.d.ts +0 -1
  37. {node v20.19 → node v24.10}/readline.d.ts +19 -14
  38. {node v20.19 → node v24.10}/repl.d.ts +25 -17
  39. {node v20.19 → node v24.10}/sea.d.ts +11 -2
  40. node v24.10/sqlite.d.ts +937 -0
  41. {node v20.19 → node v24.10}/stream/web.d.ts +85 -45
  42. {node v20.19 → node v24.10}/stream.d.ts +36 -28
  43. {node v20.19 → node v24.10}/string_decoder.d.ts +1 -1
  44. {node v20.19 → node v24.10}/test.d.ts +587 -35
  45. {node v20.19 → node v24.10}/timers/promises.d.ts +1 -1
  46. {node v20.19 → node v24.10}/timers.d.ts +4 -5
  47. {node v20.19 → node v24.10}/tls.d.ts +62 -48
  48. {node v20.19 → node v24.10}/trace_events.d.ts +6 -6
  49. node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
  50. {node v20.19 → node v24.10}/ts5.6/globals.typedarray.d.ts +2 -0
  51. {node v20.19 → node v24.10}/ts5.6/index.d.ts +15 -5
  52. node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
  53. node v24.10/ts5.7/index.d.ts +103 -0
  54. {node v20.19 → node v24.10}/tty.d.ts +1 -1
  55. {node v20.19 → node v24.10}/url.d.ts +128 -35
  56. {node v20.19 → node v24.10}/util.d.ts +384 -390
  57. {node v20.19 → node v24.10}/v8.d.ts +175 -32
  58. {node v20.19 → node v24.10}/vm.d.ts +246 -67
  59. {node v20.19 → node v24.10}/wasi.d.ts +23 -2
  60. node v24.10/web-globals/crypto.d.ts +32 -0
  61. {node v20.19 → node v24.10}/web-globals/fetch.d.ts +4 -0
  62. node v24.10/web-globals/navigator.d.ts +25 -0
  63. node v24.10/web-globals/storage.d.ts +24 -0
  64. node v24.10/web-globals/streams.d.ts +22 -0
  65. {node v20.19 → node v24.10}/worker_threads.d.ts +205 -24
  66. {node v20.19 → node v24.10}/zlib.d.ts +185 -44
  67. node v20.19/assert/strict.d.ts +0 -8
  68. node v20.19/compatibility/disposable.d.ts +0 -16
  69. node v20.19/compatibility/index.d.ts +0 -9
  70. node v20.19/compatibility/indexable.d.ts +0 -20
  71. {node v20.19 → node v24.10}/LICENSE +0 -0
  72. {node v20.19 → node v24.10}/compatibility/iterators.d.ts +0 -0
  73. {node v20.19 → node v24.10}/constants.d.ts +0 -0
  74. {node v20.19 → node v24.10}/stream/consumers.d.ts +0 -0
  75. {node v20.19 → node v24.10}/stream/promises.d.ts +0 -0
  76. {node v20.19 → node v24.10}/ts5.6/buffer.buffer.d.ts +0 -0
  77. {node v20.19 → node v24.10}/web-globals/abortcontroller.d.ts +0 -0
  78. {node v20.19 → node v24.10}/web-globals/domexception.d.ts +0 -0
  79. {node v20.19 → node v24.10}/web-globals/events.d.ts +0 -0
@@ -5,7 +5,7 @@
5
5
  * ```js
6
6
  * import url from 'node:url';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/url.js)
8
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/url.js)
9
9
  */
10
10
  declare module "url" {
11
11
  import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
@@ -50,10 +50,18 @@ declare module "url" {
50
50
  /**
51
51
  * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
52
52
  * @default undefined
53
+ * @since v22.1.0
54
+ */
55
+ windows?: boolean | undefined;
56
+ }
57
+ interface PathToFileUrlOptions {
58
+ /**
59
+ * `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default.
60
+ * @default undefined
61
+ * @since v22.1.0
53
62
  */
54
63
  windows?: boolean | undefined;
55
64
  }
56
- interface PathToFileUrlOptions extends FileUrlToPathOptions {}
57
65
  /**
58
66
  * The `url.parse()` method takes a URL string, parses it, and returns a URL
59
67
  * object.
@@ -63,20 +71,44 @@ declare module "url" {
63
71
  * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
64
72
  *
65
73
  * `url.parse()` uses a lenient, non-standard algorithm for parsing URL
66
- * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487) and incorrect handling of usernames and passwords. Do not use with untrusted
67
- * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the `WHATWG URL` API instead.
74
+ * strings. It is prone to security issues such as [host name spoofing](https://hackerone.com/reports/678487)
75
+ * and incorrect handling of usernames and passwords. Do not use with untrusted
76
+ * input. CVEs are not issued for `url.parse()` vulnerabilities. Use the
77
+ * [WHATWG URL](https://nodejs.org/docs/latest-v24.x/api/url.html#the-whatwg-url-api) API instead, for example:
78
+ *
79
+ * ```js
80
+ * function getURL(req) {
81
+ * const proto = req.headers['x-forwarded-proto'] || 'https';
82
+ * const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';
83
+ * return new URL(req.url || '/', `${proto}://${host}`);
84
+ * }
85
+ * ```
86
+ *
87
+ * The example above assumes well-formed headers are forwarded from a reverse
88
+ * proxy to your Node.js server. If you are not using a reverse proxy, you should
89
+ * use the example below:
90
+ *
91
+ * ```js
92
+ * function getURL(req) {
93
+ * return new URL(req.url || '/', 'https://example.com');
94
+ * }
95
+ * ```
68
96
  * @since v0.1.25
69
97
  * @deprecated Use the WHATWG URL API instead.
70
98
  * @param urlString The URL string to parse.
71
- * @param [parseQueryString=false] If `true`, the `query` property will always be set to an object returned by the {@link querystring} module's `parse()` method. If `false`, the `query` property
72
- * on the returned URL object will be an unparsed, undecoded string.
73
- * @param [slashesDenoteHost=false] If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the
74
- * result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
99
+ * @param parseQueryString If `true`, the `query` property will always
100
+ * be set to an object returned by the [`querystring`](https://nodejs.org/docs/latest-v24.x/api/querystring.html) module's `parse()`
101
+ * method. If `false`, the `query` property on the returned URL object will be an
102
+ * unparsed, undecoded string. **Default:** `false`.
103
+ * @param slashesDenoteHost If `true`, the first token after the literal
104
+ * string `//` and preceding the next `/` will be interpreted as the `host`.
105
+ * For instance, given `//foo/bar`, the result would be
106
+ * `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.
107
+ * **Default:** `false`.
75
108
  */
76
- function parse(urlString: string): UrlWithStringQuery;
77
109
  function parse(
78
110
  urlString: string,
79
- parseQueryString: false | undefined,
111
+ parseQueryString?: false,
80
112
  slashesDenoteHost?: boolean,
81
113
  ): UrlWithStringQuery;
82
114
  function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
@@ -307,6 +339,17 @@ declare module "url" {
307
339
  * @return The fully-resolved platform-specific Node.js file path.
308
340
  */
309
341
  function fileURLToPath(url: string | URL, options?: FileUrlToPathOptions): string;
342
+ /**
343
+ * Like `url.fileURLToPath(...)` except that instead of returning a string
344
+ * representation of the path, a `Buffer` is returned. This conversion is
345
+ * helpful when the input URL contains percent-encoded segments that are
346
+ * not valid UTF-8 / Unicode sequences.
347
+ * @since v24.3.0
348
+ * @param url The file URL string or URL object to convert to a path.
349
+ * @returns The fully-resolved platform-specific Node.js file path
350
+ * as a `Buffer`.
351
+ */
352
+ function fileURLToPathBuffer(url: string | URL, options?: FileUrlToPathOptions): NonSharedBuffer;
310
353
  /**
311
354
  * This function ensures that `path` is resolved absolutely, and that the URL
312
355
  * control characters are correctly encoded when converting into a File URL.
@@ -412,14 +455,12 @@ declare module "url" {
412
455
  * Threads, `Blob` objects registered within one Worker will not be available
413
456
  * to other workers or the main thread.
414
457
  * @since v16.7.0
415
- * @experimental
416
458
  */
417
459
  static createObjectURL(blob: NodeBlob): string;
418
460
  /**
419
461
  * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
420
462
  * ID that isn't registered will silently fail.
421
463
  * @since v16.7.0
422
- * @experimental
423
464
  * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
424
465
  */
425
466
  static revokeObjectURL(id: string): void;
@@ -438,12 +479,15 @@ declare module "url" {
438
479
  */
439
480
  static canParse(input: string, base?: string): boolean;
440
481
  /**
441
- * Parses a string as a URL. If `base` is provided, it will be used as the base URL for the purpose of resolving non-absolute `input` URLs.
442
- * Returns `null` if `input` is not a valid.
443
- * @param input The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is
444
- * `converted to a string` first.
445
- * @param base The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is `converted to a string` first.
446
- * @since v20.18.0
482
+ * Parses a string as a URL. If `base` is provided, it will be used as the base
483
+ * URL for the purpose of resolving non-absolute `input` URLs. Returns `null`
484
+ * if the parameters can't be resolved to a valid URL.
485
+ * @since v22.1.0
486
+ * @param input The absolute or relative input URL to parse. If `input`
487
+ * is relative, then `base` is required. If `input` is absolute, the `base`
488
+ * is ignored. If `input` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
489
+ * @param base The base URL to resolve against if the `input` is not
490
+ * absolute. If `base` is not a string, it is [converted to a string](https://tc39.es/ecma262/#sec-tostring) first.
447
491
  */
448
492
  static parse(input: string, base?: string): URL | null;
449
493
  constructor(input: string | { toString: () => string }, base?: string | URL);
@@ -749,6 +793,54 @@ declare module "url" {
749
793
  */
750
794
  toJSON(): string;
751
795
  }
796
+ interface URLPatternComponentResult {
797
+ input: string;
798
+ groups: Record<string, string | undefined>;
799
+ }
800
+ interface URLPatternInit {
801
+ protocol?: string;
802
+ username?: string;
803
+ password?: string;
804
+ hostname?: string;
805
+ port?: string;
806
+ pathname?: string;
807
+ search?: string;
808
+ hash?: string;
809
+ baseURL?: string;
810
+ }
811
+ interface URLPatternOptions {
812
+ ignoreCase?: boolean;
813
+ }
814
+ interface URLPatternResult {
815
+ inputs: (string | URLPatternInit)[];
816
+ protocol: URLPatternComponentResult;
817
+ username: URLPatternComponentResult;
818
+ password: URLPatternComponentResult;
819
+ hostname: URLPatternComponentResult;
820
+ port: URLPatternComponentResult;
821
+ pathname: URLPatternComponentResult;
822
+ search: URLPatternComponentResult;
823
+ hash: URLPatternComponentResult;
824
+ }
825
+ /**
826
+ * @since v23.8.0
827
+ * @experimental
828
+ */
829
+ class URLPattern {
830
+ constructor(input: string | URLPatternInit, baseURL: string, options?: URLPatternOptions);
831
+ constructor(input?: string | URLPatternInit, options?: URLPatternOptions);
832
+ exec(input?: string | URLPatternInit, baseURL?: string): URLPatternResult | null;
833
+ readonly hasRegExpGroups: boolean;
834
+ readonly hash: string;
835
+ readonly hostname: string;
836
+ readonly password: string;
837
+ readonly pathname: string;
838
+ readonly port: string;
839
+ readonly protocol: string;
840
+ readonly search: string;
841
+ test(input?: string | URLPatternInit, baseURL?: string): boolean;
842
+ readonly username: string;
843
+ }
752
844
  interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
753
845
  [Symbol.iterator](): URLSearchParamsIterator<T>;
754
846
  }
@@ -820,7 +912,7 @@ declare module "url" {
820
912
  * Returns an ES6 `Iterator` over each of the name-value pairs in the query.
821
913
  * Each item of the iterator is a JavaScript `Array`. The first item of the `Array` is the `name`, the second item of the `Array` is the `value`.
822
914
  *
823
- * Alias for `urlSearchParams[@@iterator]()`.
915
+ * Alias for `urlSearchParams[Symbol.iterator]()`.
824
916
  */
825
917
  entries(): URLSearchParamsIterator<[string, string]>;
826
918
  /**
@@ -929,34 +1021,35 @@ declare module "url" {
929
1021
  values(): URLSearchParamsIterator<string>;
930
1022
  [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
931
1023
  }
932
- import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
1024
+ import {
1025
+ URL as _URL,
1026
+ URLPattern as _URLPattern,
1027
+ URLPatternInit as _URLPatternInit,
1028
+ URLPatternResult as _URLPatternResult,
1029
+ URLSearchParams as _URLSearchParams,
1030
+ } from "url";
933
1031
  global {
934
- interface URLSearchParams extends _URLSearchParams {}
935
1032
  interface URL extends _URL {}
936
- interface Global {
937
- URL: typeof _URL;
938
- URLSearchParams: typeof _URLSearchParams;
939
- }
940
- /**
941
- * `URL` class is a global reference for `import { URL } from 'node:url'`
942
- * https://nodejs.org/api/url.html#the-whatwg-url-api
943
- * @since v10.0.0
944
- */
945
1033
  var URL: typeof globalThis extends {
946
1034
  onmessage: any;
947
1035
  URL: infer T;
948
1036
  } ? T
949
1037
  : typeof _URL;
950
- /**
951
- * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'`
952
- * https://nodejs.org/api/url.html#class-urlsearchparams
953
- * @since v10.0.0
954
- */
1038
+ interface URLSearchParams extends _URLSearchParams {}
955
1039
  var URLSearchParams: typeof globalThis extends {
956
1040
  onmessage: any;
957
1041
  URLSearchParams: infer T;
958
1042
  } ? T
959
1043
  : typeof _URLSearchParams;
1044
+ interface URLPatternInit extends _URLPatternInit {}
1045
+ interface URLPatternResult extends _URLPatternResult {}
1046
+ interface URLPattern extends _URLPattern {}
1047
+ var URLPattern: typeof globalThis extends {
1048
+ onmessage: any;
1049
+ scheduler: any; // Must be a var introduced at the same time as URLPattern.
1050
+ URLPattern: infer T;
1051
+ } ? T
1052
+ : typeof _URLPattern;
960
1053
  }
961
1054
  }
962
1055
  declare module "node:url" {