@types/node 22.15.33 → 24.10.3

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 v24.10/README.md +15 -0
  2. node v24.10/assert/strict.d.ts +111 -0
  3. {node v22.15 → node v24.10}/assert.d.ts +162 -101
  4. {node v22.15 → node v24.10}/async_hooks.d.ts +26 -6
  5. {node v22.15 → node v24.10}/buffer.buffer.d.ts +9 -0
  6. {node v22.15 → node v24.10}/buffer.d.ts +15 -7
  7. {node v22.15 → node v24.10}/child_process.d.ts +91 -164
  8. {node v22.15 → node v24.10}/cluster.d.ts +19 -20
  9. {node v22.15 → node v24.10}/compatibility/iterators.d.ts +1 -0
  10. {node v22.15 → node v24.10}/console.d.ts +19 -18
  11. {node v22.15 → node v24.10}/crypto.d.ts +1264 -356
  12. {node v22.15 → node v24.10}/dgram.d.ts +10 -9
  13. {node v22.15 → node v24.10}/diagnostics_channel.d.ts +1 -3
  14. {node v22.15 → node v24.10}/dns/promises.d.ts +12 -11
  15. {node v22.15 → node v24.10}/dns.d.ts +41 -37
  16. {node v22.15 → node v24.10}/domain.d.ts +1 -1
  17. {node v22.15 → node v24.10}/events.d.ts +81 -36
  18. {node v22.15 → node v24.10}/fs/promises.d.ts +101 -57
  19. {node v22.15 → node v24.10}/fs.d.ts +413 -136
  20. node v24.10/globals.d.ts +170 -0
  21. node v24.10/globals.typedarray.d.ts +41 -0
  22. {node v22.15 → node v24.10}/http.d.ts +187 -37
  23. {node v22.15 → node v24.10}/http2.d.ts +197 -66
  24. {node v22.15 → node v24.10}/https.d.ts +97 -63
  25. {node v22.15 → node v24.10}/index.d.ts +16 -7
  26. node v24.10/inspector.d.ts +277 -0
  27. node v22.15/inspector.d.ts → node v24.10/inspector.generated.d.ts +1059 -828
  28. {node v22.15 → node v24.10}/module.d.ts +90 -30
  29. {node v22.15 → node v24.10}/net.d.ts +35 -16
  30. {node v22.15 → node v24.10}/os.d.ts +22 -10
  31. {node v22.15 → node v24.10}/package.json +14 -84
  32. {node v22.15 → node v24.10}/path.d.ts +2 -2
  33. {node v22.15 → node v24.10}/perf_hooks.d.ts +28 -16
  34. {node v22.15 → node v24.10}/process.d.ts +40 -34
  35. {node v22.15 → node v24.10}/punycode.d.ts +1 -1
  36. {node v22.15 → node v24.10}/querystring.d.ts +1 -1
  37. {node v22.15 → node v24.10}/readline/promises.d.ts +1 -2
  38. {node v22.15 → node v24.10}/readline.d.ts +13 -13
  39. {node v22.15 → node v24.10}/repl.d.ts +25 -17
  40. {node v22.15 → node v24.10}/sea.d.ts +10 -1
  41. {node v22.15 → node v24.10}/sqlite.d.ts +438 -9
  42. {node v22.15 → node v24.10}/stream/consumers.d.ts +2 -2
  43. {node v22.15 → node v24.10}/stream/web.d.ts +13 -54
  44. {node v22.15 → node v24.10}/stream.d.ts +63 -48
  45. {node v22.15 → node v24.10}/string_decoder.d.ts +3 -3
  46. node v24.10/test.d.ts +2339 -0
  47. {node v22.15 → node v24.10}/timers/promises.d.ts +1 -1
  48. {node v22.15 → node v24.10}/timers.d.ts +1 -3
  49. {node v22.15 → node v24.10}/tls.d.ts +124 -114
  50. {node v22.15 → node v24.10}/trace_events.d.ts +6 -6
  51. {node v22.15 → node v24.10}/ts5.6/buffer.buffer.d.ts +10 -2
  52. node v24.10/ts5.6/compatibility/float16array.d.ts +71 -0
  53. node v24.10/ts5.6/globals.typedarray.d.ts +36 -0
  54. {node v22.15 → node v24.10}/ts5.6/index.d.ts +18 -7
  55. node v24.10/ts5.7/compatibility/float16array.d.ts +72 -0
  56. node v24.10/ts5.7/index.d.ts +103 -0
  57. {node v22.15 → node v24.10}/tty.d.ts +1 -1
  58. {node v22.15 → node v24.10}/url.d.ts +119 -34
  59. {node v22.15 → node v24.10}/util.d.ts +45 -304
  60. {node v22.15 → node v24.10}/v8.d.ts +68 -38
  61. {node v22.15 → node v24.10}/vm.d.ts +258 -107
  62. {node v22.15 → node v24.10}/wasi.d.ts +23 -2
  63. node v24.10/web-globals/abortcontroller.d.ts +34 -0
  64. node v24.10/web-globals/crypto.d.ts +32 -0
  65. node v24.10/web-globals/domexception.d.ts +68 -0
  66. node v22.15/dom-events.d.ts → node v24.10/web-globals/events.d.ts +49 -51
  67. node v24.10/web-globals/fetch.d.ts +50 -0
  68. node v24.10/web-globals/navigator.d.ts +25 -0
  69. node v24.10/web-globals/storage.d.ts +24 -0
  70. node v24.10/web-globals/streams.d.ts +22 -0
  71. {node v22.15 → node v24.10}/worker_threads.d.ts +206 -68
  72. {node v22.15 → node v24.10}/zlib.d.ts +44 -33
  73. node v22.15/README.md +0 -15
  74. node v22.15/assert/strict.d.ts +0 -8
  75. node v22.15/compatibility/disposable.d.ts +0 -14
  76. node v22.15/compatibility/index.d.ts +0 -9
  77. node v22.15/compatibility/indexable.d.ts +0 -20
  78. node v22.15/globals.d.ts +0 -364
  79. node v22.15/globals.typedarray.d.ts +0 -21
  80. node v22.15/test.d.ts +0 -2278
  81. node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
  82. {node v22.15 → node v24.10}/LICENSE +0 -0
  83. {node v22.15 → node v24.10}/constants.d.ts +0 -0
  84. {node v22.15 → node v24.10}/stream/promises.d.ts +0 -0
@@ -0,0 +1,36 @@
1
+ export {}; // Make this a module
2
+
3
+ declare global {
4
+ namespace NodeJS {
5
+ type TypedArray =
6
+ | Uint8Array
7
+ | Uint8ClampedArray
8
+ | Uint16Array
9
+ | Uint32Array
10
+ | Int8Array
11
+ | Int16Array
12
+ | Int32Array
13
+ | BigUint64Array
14
+ | BigInt64Array
15
+ | Float16Array
16
+ | Float32Array
17
+ | Float64Array;
18
+ type ArrayBufferView = TypedArray | DataView;
19
+
20
+ type NonSharedUint8Array = Uint8Array;
21
+ type NonSharedUint8ClampedArray = Uint8ClampedArray;
22
+ type NonSharedUint16Array = Uint16Array;
23
+ type NonSharedUint32Array = Uint32Array;
24
+ type NonSharedInt8Array = Int8Array;
25
+ type NonSharedInt16Array = Int16Array;
26
+ type NonSharedInt32Array = Int32Array;
27
+ type NonSharedBigUint64Array = BigUint64Array;
28
+ type NonSharedBigInt64Array = BigInt64Array;
29
+ type NonSharedFloat16Array = Float16Array;
30
+ type NonSharedFloat32Array = Float32Array;
31
+ type NonSharedFloat64Array = Float64Array;
32
+ type NonSharedDataView = DataView;
33
+ type NonSharedTypedArray = TypedArray;
34
+ type NonSharedArrayBufferView = ArrayBufferView;
35
+ }
36
+ }
@@ -22,20 +22,32 @@
22
22
  * IN THE SOFTWARE.
23
23
  */
24
24
 
25
- // NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
25
+ // NOTE: These definitions support Node.js and TypeScript 5.2 through 5.6.
26
26
 
27
- // Reference required TypeScript libs:
27
+ // Reference required TypeScript libraries:
28
28
  /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
29
30
 
30
- // TypeScript backwards-compatibility definitions:
31
- /// <reference path="../compatibility/index.d.ts" />
31
+ // TypeScript library polyfills required for TypeScript <=5.6:
32
+ /// <reference path="./compatibility/float16array.d.ts" />
32
33
 
33
- // Definitions specific to TypeScript 4.9 through 5.6:
34
+ // Iterator definitions required for compatibility with TypeScript <5.6:
35
+ /// <reference path="../compatibility/iterators.d.ts" />
36
+
37
+ // Definitions for Node.js modules specific to TypeScript <=5.6:
34
38
  /// <reference path="./globals.typedarray.d.ts" />
35
39
  /// <reference path="./buffer.buffer.d.ts" />
36
40
 
37
41
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
38
42
  /// <reference path="../globals.d.ts" />
43
+ /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
45
+ /// <reference path="../web-globals/domexception.d.ts" />
46
+ /// <reference path="../web-globals/events.d.ts" />
47
+ /// <reference path="../web-globals/fetch.d.ts" />
48
+ /// <reference path="../web-globals/navigator.d.ts" />
49
+ /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
39
51
  /// <reference path="../assert.d.ts" />
40
52
  /// <reference path="../assert/strict.d.ts" />
41
53
  /// <reference path="../async_hooks.d.ts" />
@@ -49,9 +61,7 @@
49
61
  /// <reference path="../diagnostics_channel.d.ts" />
50
62
  /// <reference path="../dns.d.ts" />
51
63
  /// <reference path="../dns/promises.d.ts" />
52
- /// <reference path="../dns/promises.d.ts" />
53
64
  /// <reference path="../domain.d.ts" />
54
- /// <reference path="../dom-events.d.ts" />
55
65
  /// <reference path="../events.d.ts" />
56
66
  /// <reference path="../fs.d.ts" />
57
67
  /// <reference path="../fs/promises.d.ts" />
@@ -59,6 +69,7 @@
59
69
  /// <reference path="../http2.d.ts" />
60
70
  /// <reference path="../https.d.ts" />
61
71
  /// <reference path="../inspector.d.ts" />
72
+ /// <reference path="../inspector.generated.d.ts" />
62
73
  /// <reference path="../module.d.ts" />
63
74
  /// <reference path="../net.d.ts" />
64
75
  /// <reference path="../os.d.ts" />
@@ -0,0 +1,72 @@
1
+ // Interface declaration for Float16Array, required in @types/node v24+.
2
+ // These definitions are specific to TS 5.7.
3
+
4
+ // This needs all of the "common" properties/methods of the TypedArrays,
5
+ // otherwise the type unions `TypedArray` and `ArrayBufferView` will be
6
+ // empty objects.
7
+ interface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
8
+ readonly BYTES_PER_ELEMENT: number;
9
+ readonly buffer: TArrayBuffer;
10
+ readonly byteLength: number;
11
+ readonly byteOffset: number;
12
+ readonly length: number;
13
+ readonly [Symbol.toStringTag]: "Float16Array";
14
+ at(index: number): number | undefined;
15
+ copyWithin(target: number, start: number, end?: number): this;
16
+ entries(): ArrayIterator<[number, number]>;
17
+ every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
18
+ fill(value: number, start?: number, end?: number): this;
19
+ filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;
20
+ find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
21
+ findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
22
+ findLast<S extends number>(
23
+ predicate: (value: number, index: number, array: this) => value is S,
24
+ thisArg?: any,
25
+ ): S | undefined;
26
+ findLast(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number | undefined;
27
+ findLastIndex(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number;
28
+ forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
29
+ includes(searchElement: number, fromIndex?: number): boolean;
30
+ indexOf(searchElement: number, fromIndex?: number): number;
31
+ join(separator?: string): string;
32
+ keys(): ArrayIterator<number>;
33
+ lastIndexOf(searchElement: number, fromIndex?: number): number;
34
+ map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;
35
+ reduce(
36
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
37
+ ): number;
38
+ reduce(
39
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
40
+ initialValue: number,
41
+ ): number;
42
+ reduce<U>(
43
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
44
+ initialValue: U,
45
+ ): U;
46
+ reduceRight(
47
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
48
+ ): number;
49
+ reduceRight(
50
+ callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
51
+ initialValue: number,
52
+ ): number;
53
+ reduceRight<U>(
54
+ callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
55
+ initialValue: U,
56
+ ): U;
57
+ reverse(): this;
58
+ set(array: ArrayLike<number>, offset?: number): void;
59
+ slice(start?: number, end?: number): Float16Array<ArrayBuffer>;
60
+ some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
61
+ sort(compareFn?: (a: number, b: number) => number): this;
62
+ subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;
63
+ toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
64
+ toReversed(): Float16Array<ArrayBuffer>;
65
+ toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;
66
+ toString(): string;
67
+ valueOf(): this;
68
+ values(): ArrayIterator<number>;
69
+ with(index: number, value: number): Float16Array<ArrayBuffer>;
70
+ [Symbol.iterator](): ArrayIterator<number>;
71
+ [index: number]: number;
72
+ }
@@ -0,0 +1,103 @@
1
+ /**
2
+ * License for programmatically and manually incorporated
3
+ * documentation aka. `JSDoc` from https://github.com/nodejs/node/tree/master/doc
4
+ *
5
+ * Copyright Node.js contributors. All rights reserved.
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to
8
+ * deal in the Software without restriction, including without limitation the
9
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
+ * sell copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in
14
+ * all copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
+ * IN THE SOFTWARE.
23
+ */
24
+
25
+ // NOTE: These definitions support Node.js and TypeScript 5.7.
26
+
27
+ // Reference required TypeScript libraries:
28
+ /// <reference lib="es2020" />
29
+ /// <reference lib="esnext.disposable" />
30
+
31
+ // TypeScript library polyfills required for TypeScript 5.7:
32
+ /// <reference path="./compatibility/float16array.d.ts" />
33
+
34
+ // Iterator definitions required for compatibility with TypeScript <5.6:
35
+ /// <reference path="../compatibility/iterators.d.ts" />
36
+
37
+ // Definitions for Node.js modules specific to TypeScript 5.7+:
38
+ /// <reference path="../globals.typedarray.d.ts" />
39
+ /// <reference path="../buffer.buffer.d.ts" />
40
+
41
+ // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
+ /// <reference path="../globals.d.ts" />
43
+ /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
45
+ /// <reference path="../web-globals/domexception.d.ts" />
46
+ /// <reference path="../web-globals/events.d.ts" />
47
+ /// <reference path="../web-globals/fetch.d.ts" />
48
+ /// <reference path="../web-globals/navigator.d.ts" />
49
+ /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
51
+ /// <reference path="../assert.d.ts" />
52
+ /// <reference path="../assert/strict.d.ts" />
53
+ /// <reference path="../async_hooks.d.ts" />
54
+ /// <reference path="../buffer.d.ts" />
55
+ /// <reference path="../child_process.d.ts" />
56
+ /// <reference path="../cluster.d.ts" />
57
+ /// <reference path="../console.d.ts" />
58
+ /// <reference path="../constants.d.ts" />
59
+ /// <reference path="../crypto.d.ts" />
60
+ /// <reference path="../dgram.d.ts" />
61
+ /// <reference path="../diagnostics_channel.d.ts" />
62
+ /// <reference path="../dns.d.ts" />
63
+ /// <reference path="../dns/promises.d.ts" />
64
+ /// <reference path="../domain.d.ts" />
65
+ /// <reference path="../events.d.ts" />
66
+ /// <reference path="../fs.d.ts" />
67
+ /// <reference path="../fs/promises.d.ts" />
68
+ /// <reference path="../http.d.ts" />
69
+ /// <reference path="../http2.d.ts" />
70
+ /// <reference path="../https.d.ts" />
71
+ /// <reference path="../inspector.d.ts" />
72
+ /// <reference path="../inspector.generated.d.ts" />
73
+ /// <reference path="../module.d.ts" />
74
+ /// <reference path="../net.d.ts" />
75
+ /// <reference path="../os.d.ts" />
76
+ /// <reference path="../path.d.ts" />
77
+ /// <reference path="../perf_hooks.d.ts" />
78
+ /// <reference path="../process.d.ts" />
79
+ /// <reference path="../punycode.d.ts" />
80
+ /// <reference path="../querystring.d.ts" />
81
+ /// <reference path="../readline.d.ts" />
82
+ /// <reference path="../readline/promises.d.ts" />
83
+ /// <reference path="../repl.d.ts" />
84
+ /// <reference path="../sea.d.ts" />
85
+ /// <reference path="../sqlite.d.ts" />
86
+ /// <reference path="../stream.d.ts" />
87
+ /// <reference path="../stream/promises.d.ts" />
88
+ /// <reference path="../stream/consumers.d.ts" />
89
+ /// <reference path="../stream/web.d.ts" />
90
+ /// <reference path="../string_decoder.d.ts" />
91
+ /// <reference path="../test.d.ts" />
92
+ /// <reference path="../timers.d.ts" />
93
+ /// <reference path="../timers/promises.d.ts" />
94
+ /// <reference path="../tls.d.ts" />
95
+ /// <reference path="../trace_events.d.ts" />
96
+ /// <reference path="../tty.d.ts" />
97
+ /// <reference path="../url.d.ts" />
98
+ /// <reference path="../util.d.ts" />
99
+ /// <reference path="../v8.d.ts" />
100
+ /// <reference path="../vm.d.ts" />
101
+ /// <reference path="../wasi.d.ts" />
102
+ /// <reference path="../worker_threads.d.ts" />
103
+ /// <reference path="../zlib.d.ts" />
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * In most cases, there should be little to no reason for an application to
23
23
  * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
24
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/tty.js)
24
+ * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/tty.js)
25
25
  */
26
26
  declare module "tty" {
27
27
  import * as net from "node:net";
@@ -5,10 +5,10 @@
5
5
  * ```js
6
6
  * import url from 'node:url';
7
7
  * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v22.x/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
- import { Blob as NodeBlob } from "node:buffer";
11
+ import { Blob as NodeBlob, NonSharedBuffer } from "node:buffer";
12
12
  import { ClientRequestArgs } from "node:http";
13
13
  import { ParsedUrlQuery, ParsedUrlQueryInput } from "node:querystring";
14
14
  // Input to `url.format`
@@ -71,20 +71,44 @@ declare module "url" {
71
71
  * A `URIError` is thrown if the `auth` property is present but cannot be decoded.
72
72
  *
73
73
  * `url.parse()` uses a lenient, non-standard algorithm for parsing URL
74
- * 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
75
- * 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
+ * ```
76
96
  * @since v0.1.25
77
97
  * @deprecated Use the WHATWG URL API instead.
78
98
  * @param urlString The URL string to parse.
79
- * @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
80
- * on the returned URL object will be an unparsed, undecoded string.
81
- * @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
82
- * 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`.
83
108
  */
84
- function parse(urlString: string): UrlWithStringQuery;
85
109
  function parse(
86
110
  urlString: string,
87
- parseQueryString: false | undefined,
111
+ parseQueryString?: false,
88
112
  slashesDenoteHost?: boolean,
89
113
  ): UrlWithStringQuery;
90
114
  function parse(urlString: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
@@ -315,6 +339,17 @@ declare module "url" {
315
339
  * @return The fully-resolved platform-specific Node.js file path.
316
340
  */
317
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;
318
353
  /**
319
354
  * This function ensures that `path` is resolved absolutely, and that the URL
320
355
  * control characters are correctly encoded when converting into a File URL.
@@ -420,14 +455,12 @@ declare module "url" {
420
455
  * Threads, `Blob` objects registered within one Worker will not be available
421
456
  * to other workers or the main thread.
422
457
  * @since v16.7.0
423
- * @experimental
424
458
  */
425
459
  static createObjectURL(blob: NodeBlob): string;
426
460
  /**
427
461
  * Removes the stored `Blob` identified by the given ID. Attempting to revoke a
428
462
  * ID that isn't registered will silently fail.
429
463
  * @since v16.7.0
430
- * @experimental
431
464
  * @param id A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.
432
465
  */
433
466
  static revokeObjectURL(id: string): void;
@@ -446,12 +479,15 @@ declare module "url" {
446
479
  */
447
480
  static canParse(input: string, base?: string): boolean;
448
481
  /**
449
- * 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.
450
- * Returns `null` if `input` is not a valid.
451
- * @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
452
- * `converted to a string` first.
453
- * @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.
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.
454
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.
455
491
  */
456
492
  static parse(input: string, base?: string): URL | null;
457
493
  constructor(input: string | { toString: () => string }, base?: string | URL);
@@ -757,6 +793,54 @@ declare module "url" {
757
793
  */
758
794
  toJSON(): string;
759
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
+ }
760
844
  interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
761
845
  [Symbol.iterator](): URLSearchParamsIterator<T>;
762
846
  }
@@ -828,7 +912,7 @@ declare module "url" {
828
912
  * Returns an ES6 `Iterator` over each of the name-value pairs in the query.
829
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`.
830
914
  *
831
- * Alias for `urlSearchParams[@@iterator]()`.
915
+ * Alias for `urlSearchParams[Symbol.iterator]()`.
832
916
  */
833
917
  entries(): URLSearchParamsIterator<[string, string]>;
834
918
  /**
@@ -937,34 +1021,35 @@ declare module "url" {
937
1021
  values(): URLSearchParamsIterator<string>;
938
1022
  [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
939
1023
  }
940
- 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";
941
1031
  global {
942
- interface URLSearchParams extends _URLSearchParams {}
943
1032
  interface URL extends _URL {}
944
- interface Global {
945
- URL: typeof _URL;
946
- URLSearchParams: typeof _URLSearchParams;
947
- }
948
- /**
949
- * `URL` class is a global reference for `import { URL } from 'url'`
950
- * https://nodejs.org/api/url.html#the-whatwg-url-api
951
- * @since v10.0.0
952
- */
953
1033
  var URL: typeof globalThis extends {
954
1034
  onmessage: any;
955
1035
  URL: infer T;
956
1036
  } ? T
957
1037
  : typeof _URL;
958
- /**
959
- * `URLSearchParams` class is a global reference for `import { URLSearchParams } from 'node:url'`
960
- * https://nodejs.org/api/url.html#class-urlsearchparams
961
- * @since v10.0.0
962
- */
1038
+ interface URLSearchParams extends _URLSearchParams {}
963
1039
  var URLSearchParams: typeof globalThis extends {
964
1040
  onmessage: any;
965
1041
  URLSearchParams: infer T;
966
1042
  } ? T
967
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;
968
1053
  }
969
1054
  }
970
1055
  declare module "node:url" {